From b8d84d967320cbb12a81310a6627680a1c70caf1 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Tue, 28 Jul 2026 11:21:02 -0400 Subject: [PATCH] Fix racy assertion during finalization. --- Python/pylifecycle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 01ca459b2eb2b8..500a1a1949a5a8 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.