summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 82c9558..08ec586 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