We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51d1035 commit c732eccCopy full SHA for c732ecc
Python/pystate.c
@@ -875,7 +875,9 @@ PyThreadState_New(PyInterpreterState *interp)
875
PyThreadState *tstate = new_threadstate(interp);
876
if (tstate) {
877
_PyThreadState_SetCurrent(tstate);
878
- if (PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0) {
+ if (_PyThreadState_GET()
879
+ && PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0
880
+ ) {
881
PyThreadState_Clear(tstate);
882
_PyThreadState_DeleteCurrent(tstate);
883
return NULL;
0 commit comments