Skip to content

Commit cde283d

Browse files
authored
bpo-40521: Fix _PyContext_Fini() (GH-21103)
Only clear _token_missing in the main interpreter.
1 parent 2f9ada9 commit cde283d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/context.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,9 @@ _PyContext_ClearFreeList(PyThreadState *tstate)
13021302
void
13031303
_PyContext_Fini(PyThreadState *tstate)
13041304
{
1305-
Py_CLEAR(_token_missing);
1305+
if (_Py_IsMainInterpreter(tstate)) {
1306+
Py_CLEAR(_token_missing);
1307+
}
13061308
_PyContext_ClearFreeList(tstate);
13071309
#ifdef Py_DEBUG
13081310
struct _Py_context_state *state = &tstate->interp->context;

0 commit comments

Comments
 (0)