bpo-38858: Factorize Py_EndInterpreter() code (GH-17273)

* Factorize code in common between Py_FinalizeEx() and
  Py_EndInterpreter().
* Py_EndInterpreter() now also calls _PyWarnings_Fini().
* Call _PyExc_Fini() and _PyGC_Fini() later in the finalization.
This commit is contained in:
Victor Stinner 2019-11-20 10:38:34 +01:00 committed by GitHub
parent b8462477bf
commit 7eee5beaf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 58 deletions

View file

@ -1143,9 +1143,9 @@ _PyGILState_GetInterpreterStateUnsafe(void)
}
void
_PyGILState_Fini(_PyRuntimeState *runtime)
_PyGILState_Fini(PyThreadState *tstate)
{
struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
struct _gilstate_runtime_state *gilstate = &tstate->interp->runtime->gilstate;
PyThread_tss_delete(&gilstate->autoTSSkey);
gilstate->autoInterpreterState = NULL;
}