]> granicus.if.org Git - python/commitdiff
fix building without threads (closes #23877)
authorBenjamin Peterson <benjamin@python.org>
Mon, 6 Apr 2015 13:59:23 +0000 (09:59 -0400)
committerBenjamin Peterson <benjamin@python.org>
Mon, 6 Apr 2015 13:59:23 +0000 (09:59 -0400)
Python/pylifecycle.c

index bab3a2f38a8c90ee84534f0fbf993b96619573f7..e5645494e636cb8dace5e2f5c53d7f30a8d414d2 100644 (file)
@@ -1299,8 +1299,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 */