[issue22906] PEP 479: Change StopIteration handling inside generators

Stefan Behnel report at bugs.python.org
Sat Nov 29 09:59:59 CET 2014


Stefan Behnel added the comment:

Ah, right - chaining only happens automatically when the exception has already been caught and moved to sys.exc_info.

There's a _PyErr_ChainExceptions(), though, which does it for you. You should be able to say

    PyErr_Fetch(&x,&y,&z)
    PyErr_SetString()
    _PyErr_ChainExceptions(x,y,z)

(does pretty much what your code does as well)

----------

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


More information about the Python-bugs-list mailing list