Message145609
| Author |
pitrou |
| Recipients |
ncoghlan, pitrou |
| Date |
2011年10月15日.23:34:29 |
| SpamBayes Score |
0.0053464114 |
| Marked as misclassified |
No |
| Message-id |
<1318721670.51.0.393760482816.issue13188@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|