pyperform icon indicating copy to clipboard operation
pyperform copied to clipboard

return in finally swallows exceptions

Open iritkatriel opened this issue 1 year ago • 0 comments

In https://github.com/lobocv/pyperform/blob/97d87e8b9ddb35bd8f2a6782965fd7735ab0349f/pyperform/thread.py#L74 there is a return statement in a finally block, which would swallow any in-flight exception.

This means that if 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.

iritkatriel avatar Oct 24 '24 22:10 iritkatriel