Message87452
There's an obscure bug in sys.exc_info after a yield statement.
def test():
def raising_generator():
try:
raise IndexError("inner exception")
except IndexError:
yield 3
# Here, sys.exc_info() ought to refer to the inner
# exception, but instead it refers to the outer one.
try:
raise ValueError("outer exception")
except ValueError:
for i in raising_generator(): pass
sys.exc_info gets reset even if there's no outer exception.
The attached (failing) patch highlights this problem, and tests other
sys.exc_info behavior around function calls. |
|
Date |
User |
Action |
Args |
2009-05-08 17:44:02 | jyasskin | set | recipients:
+ jyasskin, collinwinter |
2009-05-08 17:44:01 | jyasskin | set | messageid: <1241804641.35.0.0131164077966.issue5970@psf.upfronthosting.co.za> |
2009-05-08 17:44:00 | jyasskin | link | issue5970 messages |
2009-05-08 17:43:59 | jyasskin | create | |
|