summaryrefslogtreecommitdiff
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index aaf58119e5..4fc6a1596f 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -692,6 +692,7 @@ Py_FinalizeEx(void)
/* Delete current thread. After this, many C API calls become crashy. */
PyThreadState_Swap(NULL);
+
PyInterpreterState_Delete(interp);
#ifdef Py_TRACE_REFS
@@ -743,6 +744,10 @@ Py_NewInterpreter(void)
if (!initialized)
Py_FatalError("Py_NewInterpreter: call Py_Initialize first");
+ /* Issue #10915, #15751: The GIL API doesn't work with multiple
+ interpreters: disable PyGILState_Check(). */
+ _PyGILState_check_enabled = 0;
+
interp = PyInterpreterState_New();
if (interp == NULL)
return NULL;