-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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.
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)timurbazhirov
Metadata
Metadata
Assignees
Labels
No labels