From: Peter Bierma Date: Tue, 28 Jul 2026 16:06:52 +0000 (-0400) Subject: gh-154822: Fix racy assertion during finalization (GH-154824) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb0f028537448db9457747873f8f4c9e6b607500;p=thirdparty%2FPython%2Fcpython.git gh-154822: Fix racy assertion during finalization (GH-154824) --- diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 01ca459b2eb2..500a1a1949a5 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -3827,8 +3827,8 @@ handle_thread_shutdown_exception(PyThreadState *tstate) assert(tstate != NULL); assert(_PyErr_Occurred(tstate)); PyInterpreterState *interp = tstate->interp; - assert(interp->threads.head != NULL); _PyEval_StopTheWorld(interp); + assert(interp->threads.head != NULL); // We don't have to worry about locking this because the // world is stopped.