Skip to content

Commit 2c4b6ec

Browse files
alexhenriefacebook-github-bot
authored andcommitted
Unused exception variables (#50181)
Summary: These unused variables were identified by [pyflakes](https://pypi.org/project/pyflakes/). They can be safely removed to simplify the code. Pull Request resolved: #50181 Reviewed By: gchanan Differential Revision: D25844270 fbshipit-source-id: 0e648ffe8c6db6daf56788a13ba89806923cbb76
1 parent 8f31621 commit 2c4b6ec

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

torch/_jit_internal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def parseExpr(expr, module):
8080
value, len_parsed = parseNestedExpr(expr, module)
8181
assert len_parsed == len(expr), "whole expression was not parsed, falling back to c++ parser"
8282
return value
83-
except Exception as e:
83+
except Exception:
8484
"""
8585
The python resolver fails in several cases in known unit tests, and is intended
8686
to fall back gracefully to the c++ resolver in general. For example, python 2 style

torch/distributed/launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def sigkill_handler(signum, frame):
295295
print(f"Killing subprocess {process.pid}")
296296
try:
297297
process.kill()
298-
except Exception as e:
298+
except Exception:
299299
pass
300300
if last_return_code is not None:
301301
raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd)

torch/distributed/rpc/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def _rref_typeof_on_user(rref):
381381
# Combine the implementation class and the type class.
382382
class RRef(PyRRef, Generic[T]):
383383
pass
384-
except TypeError as exc:
384+
except TypeError:
385385
# TypeError: metaclass conflict: the metaclass of a derived class
386386
# must be a (non-strict) subclass of the metaclasses of all its bases
387387
# Mypy doesn't understand __class__ (mypy bug #4177)

0 commit comments

Comments
 (0)