mirror of
https://github.com/python/cpython.git
synced 2025-10-05 06:31:48 +00:00
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 7c30d12bd5
)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
This commit is contained in:
parent
a08b7c3bb0
commit
7f77ac463c
7 changed files with 130 additions and 23 deletions
|
@ -51,7 +51,7 @@ PyAPI_FUNC(void) _PyErr_SetObject(
|
|||
PyObject *value);
|
||||
|
||||
PyAPI_FUNC(void) _PyErr_ChainStackItem(
|
||||
_PyErr_StackItem *exc_state);
|
||||
_PyErr_StackItem *exc_info);
|
||||
|
||||
PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue