python-humanfriendly
python-humanfriendly copied to clipboard
return in finally swallows exceptions
In https://github.com/xolox/python-humanfriendly/blob/6758ac61f906cd8528682003070a57febe4ad3cf/humanfriendly/testing.py#L542 there is a return statement in a finally block, which would swallow any in-flight exception.
This means that if the try block raises AssertionError, this will not be raised (in contradiction to the function's docstring).
See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.