commit 5919f3654b1ffd78fb535d485dc879c7d652c6be Author: Dave Rolek dmr-x@riseup.net Date: Sun Jun 24 18:51:01 2018 +0000
Address static-check findings now reported due to upgrade to pyflakes 2.0.0
Unused 'exc' simply removed.
Fixes #26483 --- stem/descriptor/reader.py | 2 +- stem/interpreter/__init__.py | 6 +++--- stem/util/system.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/stem/descriptor/reader.py b/stem/descriptor/reader.py index 0f8547d7..40f5b71c 100644 --- a/stem/descriptor/reader.py +++ b/stem/descriptor/reader.py @@ -512,7 +512,7 @@ class DescriptorReader(object):
self._unreturned_descriptors.put(desc) self._iter_notice.set() - except TypeError as exc: + except TypeError: self._notify_skip_listeners(target, UnrecognizedType(mime_type)) except ValueError as exc: self._notify_skip_listeners(target, ParsingFailure(exc)) diff --git a/stem/interpreter/__init__.py b/stem/interpreter/__init__.py index 4c3ffea5..131ecd64 100644 --- a/stem/interpreter/__init__.py +++ b/stem/interpreter/__init__.py @@ -145,7 +145,7 @@ def main():
try: raw_input() - except (KeyboardInterrupt, stem.SocketClosed) as exc: + except (KeyboardInterrupt, stem.SocketClosed): pass else: interpreter.run_command(args.run_cmd, print_response = True) @@ -169,7 +169,7 @@ def main(): prompt = '... ' if interpreter.is_multiline_context else PROMPT user_input = input(prompt) if stem.prereq.is_python_3() else raw_input(prompt) interpreter.run_command(user_input, print_response = True) - except stem.SocketClosed as exc: + except stem.SocketClosed: if showed_close_confirmation: print(format('Unable to run tor commands. The control connection has been closed.', *ERROR_OUTPUT)) else: @@ -181,6 +181,6 @@ def main(): showed_close_confirmation = True else: break - except (KeyboardInterrupt, EOFError, stem.SocketClosed) as exc: + except (KeyboardInterrupt, EOFError, stem.SocketClosed): print('') # move cursor to the following line break diff --git a/stem/util/system.py b/stem/util/system.py index 9a69fe96..94be6b1f 100644 --- a/stem/util/system.py +++ b/stem/util/system.py @@ -1324,7 +1324,7 @@ def call(command, default = UNDEFINED, ignore_exit_status = False, timeout = Non return stdout.decode('utf-8', 'replace').splitlines() else: return [] - except CallTimeoutError as exc: + except CallTimeoutError: log.debug('System call (timeout): %s (after %0.4fs)' % (command, timeout))
if default != UNDEFINED:
tor-commits@lists.torproject.org