Skip to content
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

break in finally can swallow exception #745

Closed
iritkatriel opened this issue Oct 22, 2024 · 0 comments · Fixed by #753
Closed

break in finally can swallow exception #745

iritkatriel opened this issue Oct 22, 2024 · 0 comments · Fixed by #753

Comments

@iritkatriel
Copy link

In

there is a break statement in a finally block, which would swallow any in-flight exception.

This means that if an exception other than AttributeError, DatabaseError (including a BaseException such as KeyboardInterrupt) is raised from the try body, or any exception is raised from an except: clause, it will not propagate on as expected.

See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant