Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stop the runtime instead of the interpreter.
  • Loading branch information
ZeroIntensity committed May 24, 2025
commit a5693559bdf322a2b62058b4aad1b3861fdaaf43
5 changes: 3 additions & 2 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,8 @@ Py_EndInterpreter(PyThreadState *tstate)
_Py_FinishPendingCalls(tstate);

_PyAtExit_Call(tstate->interp);
_PyEval_StopTheWorld(interp);
_PyRuntimeState *runtime = interp->runtime;
_PyEval_StopTheWorldAll(runtime);
/* Remaining daemon threads will automatically exit
when they attempt to take the GIL (ex: PyEval_RestoreThread()). */
_PyInterpreterState_SetFinalizing(interp, tstate);
Expand All @@ -2459,7 +2460,7 @@ Py_EndInterpreter(PyThreadState *tstate)
_PyThreadState_SetShuttingDown(p);
}

_PyEval_StartTheWorld(interp);
_PyEval_StartTheWorldAll(runtime);
_PyThreadState_DeleteList(list, /*is_after_fork=*/0);

// XXX Call something like _PyImport_Disable() here?
Comment thread
ericsnowcurrently marked this conversation as resolved.
Expand Down