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 b51081c commit 236becaCopy full SHA for 236beca
Python/pystate.c
@@ -292,7 +292,9 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
292
293
HEAD_LOCK(runtime);
294
for (PyThreadState *p = interp->tstate_head; p != NULL; p = p->next) {
295
- PyThreadState_Clear(p);
+ if (p != tstate) {
296
+ PyThreadState_Clear(p);
297
+ }
298
}
299
HEAD_UNLOCK(runtime);
300
@@ -324,6 +326,7 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
324
326
325
327
/* Last garbage collection on this interpreter */
328
_PyGC_CollectNoFail(tstate);
329
+ PyThreadState_Clear(tstate);
330
_PyGC_Fini(interp);
331
332
/* We don't clear sysdict and builtins until the end of this function.
0 commit comments