bpo-40521: Fix _PyContext_Fini() (GH-21103)

Only clear _token_missing in the main interpreter.
This commit is contained in:
Victor Stinner 2020-06-24 03:21:15 +02:00 committed by GitHub
parent 2f9ada96e0
commit cde283d16d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1302,7 +1302,9 @@ _PyContext_ClearFreeList(PyThreadState *tstate)
void
_PyContext_Fini(PyThreadState *tstate)
{
Py_CLEAR(_token_missing);
if (_Py_IsMainInterpreter(tstate)) {
Py_CLEAR(_token_missing);
}
_PyContext_ClearFreeList(tstate);
#ifdef Py_DEBUG
struct _Py_context_state *state = &tstate->interp->context;