From df9b2d50b75ee42663195058f3112e6c440381c5 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 24 Dec 2018 17:05:37 -0500 Subject: 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 --- examples/dfmparse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/dfmparse.py') diff --git a/examples/dfmparse.py b/examples/dfmparse.py index d77a7ff..ae74bf0 100644 --- a/examples/dfmparse.py +++ b/examples/dfmparse.py @@ -161,7 +161,7 @@ def main(testfiles=None, action=printer): try: retval[f] = object_definition.parseFile(f) success += 1 - except: + except Exception: failures.append(f) if failures: -- cgit v1.2.1