summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/pythonrun.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 9b2405f..6d6e179 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -2642,8 +2642,12 @@ _Py_PrintFatalError(int fd)
return;
display_stack:
+#ifdef WITH_THREAD
/* PyGILState_GetThisThreadState() works even if the GIL was released */
tstate = PyGILState_GetThisThreadState();
+#else
+ tstate = PyThreadState_GET();
+#endif
if (tstate == NULL) {
/* _Py_DumpTracebackThreads() requires the thread state to display
* frames */