summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-24 16:12:19 (GMT)
committerGitHub <noreply@github.com>2020-03-24 16:12:19 (GMT)
commite97c8b0688bc62959ced477d842fcd37992ef649 (patch)
tree37a1e00c1de91f00398aaa17c18f84057106e8ca /Include
parent21bee0bd71e1ad270274499f9f58194ebb52e236 (diff)
downloadcpython-e97c8b0688bc62959ced477d842fcd37992ef649.zip
cpython-e97c8b0688bc62959ced477d842fcd37992ef649.tar.gz
cpython-e97c8b0688bc62959ced477d842fcd37992ef649.tar.bz2
bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136)
PyThreadState.frame is a borrowed reference, not a strong reference: PyThreadState_Clear() must not call Py_CLEAR(tstate->frame). Remove test_threading.test_warnings_at_exit(): we cannot warranty that the Python thread state of daemon threads is cleared in a reliable way during Python shutdown. (cherry picked from commit 5804f878e779712e803be927ca8a6df389d82cdf)
Diffstat (limited to 'Include')
-rw-r--r--Include/cpython/pystate.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 94b0809..e22b053 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -55,6 +55,7 @@ struct _ts {
struct _ts *next;
PyInterpreterState *interp;
+ /* Borrowed reference to the current frame (it can be NULL) */
struct _frame *frame;
int recursion_depth;
char overflowed; /* The stack has overflowed. Allow 50 more calls