]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 May 2020 21:35:22 +0000 (14:35 -0700)
committerGitHub <noreply@github.com>
Fri, 22 May 2020 21:35:22 +0000 (14:35 -0700)
commit7f77ac463cff219e0c8afef2611cad5080cc9df1
tree8d28a7f990479fcf34d2493553a8583b515d7e39
parenta08b7c3bb0ef9da32400d23b13f78245cd7a9541
bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)

This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
Include/internal/pycore_pyerrors.h
Lib/test/test_asyncio/test_tasks.py
Lib/test/test_generators.py
Misc/NEWS.d/next/Core and Builtins/2020-05-21-01-54-00.bpo-40696.u3n8Wx.rst [new file with mode: 0644]
Modules/_asynciomodule.c
Objects/genobject.c
Python/errors.c