New submission from Antoine Pitrou <[email protected]>:
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.
----------
components: Interpreter Core
messages: 145609
nosy: ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: generator.throw() ignores __traceback__ of exception
type: behavior
versions: Python 3.2, Python 3.3
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13188>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com