[issue13188] generator.throw() ignores __traceback__ of exception

Arkadiusz Wahlig report at bugs.python.org
Thu Oct 27 15:54:43 CEST 2011


Arkadiusz Wahlig <arkadiusz.wahlig at gmail.com> added the comment:

I don't think this should be applied to 2.7.

In 2.x, the full exception info consists of the (type, value, traceback)-trio. Programmer is expected to pass this around to retain full exception info. Re-raising just the value (exception instance) using "raise value" starts a fresh traceback. Currently "raise" and gen.throw() behave the same in that regard and there's no reason to change that.

Python 3 reduces the exception info to one object by adding __traceback__ to the exception instance so it's reasonable to expect that "raise" and gen.throw() will be able to extract the full info from just the instance.

"raise" does that today, gen.throw() didn't, hence this bug report.

----------
nosy: +yak

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13188>
_______________________________________


More information about the Python-bugs-list mailing list