Message145609
In the following code, the original traceback attached to the exception thrown into the generator is ignored:
def gen():
try:
yield
except:
raise
g = gen()
try:
1/0
except ZeroDivisionError as v:
g.throw(v)
But if you replace the last line with:
g.throw(type(v), v, v.__traceback__)
then the original traceback gets appended.
g.throw() should have fetched the __traceback__ attribute by itself. |
|
Date |
User |
Action |
Args |
2011-10-15 23:34:30 | pitrou | set | recipients:
+ pitrou, ncoghlan |
2011-10-15 23:34:30 | pitrou | set | messageid: <1318721670.51.0.393760482816.issue13188@psf.upfronthosting.co.za> |
2011-10-15 23:34:29 | pitrou | link | issue13188 messages |
2011-10-15 23:34:29 | pitrou | create | |
|