diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-24 17:05:37 -0500 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-24 17:17:09 -0500 |
commit | df9b2d50b75ee42663195058f3112e6c440381c5 (patch) | |
tree | e7f9404d6d5675308f61e5f26acaaced6e66557f /examples/verilogParse.py | |
parent | 7ee59bf9bec777b5a3f627dc2cfbde637ce9ebfc (diff) | |
download | pyparsing-git-df9b2d50b75ee42663195058f3112e6c440381c5.tar.gz |
Replace bare 'except:' with 'except Exception;'
Catching all exceptions is generally considered a bad practice under
most circumstances as it will also catch KeyboardInterrupt and
SystemExit. These special cases should be raised to the interpreter to
allow the Python process to exit.
This fix complies with pycodestyle's error code E722:
https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
> do not use bare except, specify exception instead
Diffstat (limited to 'examples/verilogParse.py')
-rw-r--r-- | examples/verilogParse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/verilogParse.py b/examples/verilogParse.py index 9477e38..da97286 100644 --- a/examples/verilogParse.py +++ b/examples/verilogParse.py @@ -81,7 +81,7 @@ psycoOn = False if usePackrat:
try:
ParserElement.enablePackrat()
- except:
+ except Exception:
pass
else:
packratOn = True
@@ -91,7 +91,7 @@ if usePsyco: try:
import psyco
psyco.full()
- except:
+ except Exception:
print("failed to import psyco Python optimizer")
else:
psycoOn = True
|