-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
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
Bugfix: don't intercept normal SystemExit(0) in Tool #2575
Conversation
This comment has been minimized.
This comment has been minimized.
Analysis Details1 IssueCoverage and DuplicationsProject ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs |
I am somewhat surprised this bugfix ended up being needed as there was a discussion about catching Looking at the pre-existing test it simply checked the return value, which the buggy version didn't change, and forgetting My conclusion is that we need some better guidance on where tests should go, because I don't see a reason why the test code for |
I think it's just that before this fix, |
@kosack I think the original PR also included a write to the provenance log that didn't happen before the catch to But I with the Provenance log not getting a lot of attention it is understandably why nobody bothered to have a check of its status (is there even easy ways to check its status programmatically?). |
The interception of
SystemExit
introduced harmless, but annoying bug: the error message was printed while calling any tool withhelp
option, i.e.:Full log
With this fix in case a
SystemExit
with exit code 0 is intercepted, nothing will be done (finally
clause is still honored)