From: Berker Peksag <berker.peksag@gmail.com>
Date: Mon, 27 Jul 2015 13:46:11 +0000 (+0300)
Subject: Issue #24728: Fix building without threads.
X-Git-Tag: v3.5.0rc1~6^2~45
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bd5fb0112b26310cc9db8ac92ce6936385be26c;p=python

Issue #24728: Fix building without threads.

Patch by Louis Dassy.
---

diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 9b2405f05f..6d6e1794a3 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 */