Do not use bare "except:"
Issue #948
resolved
A bare "except:" (without listing an exception class) will intercept all exceptions, including the user typing control-C to abort. This should therefore not be used, except if (a) the code will abort anyway with an appropriate user-visible error message, or (b) the code will re-raise the exception via "raise".
In particular, Simfactory catches filesystem errors with bare excepts; this should be cleaned up.
Keyword:
Comments (5)
-
-
-
assigned issue to
- edited description
-
assigned issue to
-
- changed status to open
Please review
-
Unless objected I will apply this after 2020-01-03.
-
- changed status to resolved
Applied as git hash 1b48150 "simfactory: replace bare except with typed except" of simfactory2
- Log in to comment
Pull request to fix this is here: https://bitbucket.org/simfactory/simfactory2/pull-requests/33/simfactory-replace-bare-except-with-typed/diff