Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,9 @@ PyThreadState_New(PyInterpreterState *interp)
PyThreadState *tstate = new_threadstate(interp);
if (tstate) {
_PyThreadState_SetCurrent(tstate);
if (PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0) {
if (_PyThreadState_GET()
&& PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0
) {
PyThreadState_Clear(tstate);
_PyThreadState_DeleteCurrent(tstate);
return NULL;
Expand Down