]> granicus.if.org Git - python/commitdiff
Issue #24728: Fix building without threads.
authorBerker Peksag <berker.peksag@gmail.com>
Mon, 27 Jul 2015 13:46:11 +0000 (16:46 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Mon, 27 Jul 2015 13:46:11 +0000 (16:46 +0300)
Patch by Louis Dassy.

Python/pythonrun.c

index 9b2405f05fdad82e1ac33b24569d751da97ad752..6d6e1794a32de0cde72bb0df862108ff79de2969 100644 (file)
@@ -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 */