Message150544
Hi,
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
Cheers,
Siniša |
|
Date |
User |
Action |
Args |
2012-01-03 22:13:08 | ssegvic | set | recipients:
+ ssegvic, docs@python |
2012-01-03 22:13:08 | ssegvic | set | messageid: <1325628788.79.0.655122317093.issue13705@psf.upfronthosting.co.za> |
2012-01-03 22:13:08 | ssegvic | link | issue13705 messages |
2012-01-03 22:13:07 | ssegvic | create | |
|