bpo-29587: Enable implicit exception chaining with gen.throw() by cjerdonek · Pull Request #19823 · python/cpython
added 2 commits
vstinner
changed the title
bpo-29587: Enable implicit exception chaining with gen.throw()
[WIP] bpo-29587: Enable implicit exception chaining with gen.throw()
cjerdonek
marked this pull request as ready for review
cjerdonek
changed the title
[WIP] bpo-29587: Enable implicit exception chaining with gen.throw()
bpo-29587: Enable implicit exception chaining with gen.throw()
This was referenced
cjerdonek added a commit that referenced this pull request
This is a follow-up to GH-19823 that removes the check that the exception value isn't NULL, prior to calling _PyErr_ChainExceptions(). This enables implicit exception chaining for gen.throw() in more circumstances. The commit also adds a test that a particular code snippet involving gen.throw() doesn't crash. The test shows why the new `gi_exc_state.exc_type != Py_None` check that was added is necessary. Without the new check, the code snippet (as well as a number of other tests) crashes on certain platforms (e.g. Fedora but not Mac).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters