You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2012-01-03.22:31:00.401>created_at=<Date2012-01-03.22:13:08.206>labels= ['type-feature', 'docs']
title='Raising exceptions from finally works better than advertised in the documentation'updated_at=<Date2012-01-03.22:31:00.400>user='https://bugs.python.org/ssegvic'
The documentation says:
"""
If the finally clause raises another exception (...) the saved exception is lost.
"""
This does not appear to be true.
In the example below the backtrace shows both exceptions.
>>> import math
>>> try:
... 1/0
... finally:
... math.sqrt(-1)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
ValueError: math domain error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: