From 961f153b38127c6358e7a7e44880109d5440b150 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 14 Feb 2024 11:25:38 -0700 Subject: [PATCH] Temporarily assume the main interpreter is always running "main". --- Python/pystate.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Python/pystate.c b/Python/pystate.c index 82c955882185e8..08ec586963ce11 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1044,7 +1044,14 @@ _PyInterpreterState_SetNotRunningMain(PyInterpreterState *interp) int _PyInterpreterState_IsRunningMain(PyInterpreterState *interp) { - return (interp->threads.main != NULL); + if (interp->threads.main != NULL) { + return 1; + } + // For now, we assume the main interpreter is always running. + if (_Py_IsMainInterpreter(interp)) { + return 1; + } + return 0; } int