We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There's a few "naked" or bare exception usage that can yield some difficult to track down bugs.
There's a difference between except: and except Exception. The former is catching SystemExit, KeyboardInterrupt, and GeneratorExit.
except:
except Exception
https://docs.python.org/3/library/exceptions.html#exception-hierarchy
http://www.wilfred.me.uk/blog/2013/11/03/no-naked-excepts/
Some tooling, such as pylint can help proactively catch some of these potential issues.
pylint
$ pylint express | grep -i bare-except express/parsers/structure.py:92:8: W0702: No exception type(s) specified (bare-except) express/parsers/structure.py:96:12: W0702: No exception type(s) specified (bare-except) express/parsers/formats/xml.py:20:12: W0702: No exception type(s) specified (bare-except) express/parsers/apps/vasp/parser.py:128:8: W0702: No exception type(s) specified (bare-except) express/parsers/apps/espresso/parser.py:331:12: W0702: No exception type(s) specified (bare-except) express/properties/material.py:66:8: W0702: No exception type(s) specified (bare-except)
The text was updated successfully, but these errors were encountered:
Hi Michael - thanks for pointing this out! We'll review and plan to schedule this for inclusion in the near term.
Sorry, something went wrong.
No branches or pull requests
There's a few "naked" or bare exception usage that can yield some difficult to track down bugs.
There's a difference between
except:
andexcept Exception
. The former is catching SystemExit, KeyboardInterrupt, and GeneratorExit.https://docs.python.org/3/library/exceptions.html#exception-hierarchy
http://www.wilfred.me.uk/blog/2013/11/03/no-naked-excepts/
Some tooling, such as
pylint
can help proactively catch some of these potential issues.$ pylint express | grep -i bare-except express/parsers/structure.py:92:8: W0702: No exception type(s) specified (bare-except) express/parsers/structure.py:96:12: W0702: No exception type(s) specified (bare-except) express/parsers/formats/xml.py:20:12: W0702: No exception type(s) specified (bare-except) express/parsers/apps/vasp/parser.py:128:8: W0702: No exception type(s) specified (bare-except) express/parsers/apps/espresso/parser.py:331:12: W0702: No exception type(s) specified (bare-except) express/properties/material.py:66:8: W0702: No exception type(s) specified (bare-except)
The text was updated successfully, but these errors were encountered: