summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-07-27 13:46:11 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-07-27 13:46:11 (GMT)
commit0bd5fb0112b26310cc9db8ac92ce6936385be26c (patch)
tree4c3a6e3e1001bb2789485eea699835f7a0101706
parentddc7440b0e9fe53e0dfdc4b11db1a61deb694267 (diff)
downloadcpython-0bd5fb0112b26310cc9db8ac92ce6936385be26c.zip
cpython-0bd5fb0112b26310cc9db8ac92ce6936385be26c.tar.gz
cpython-0bd5fb0112b26310cc9db8ac92ce6936385be26c.tar.bz2
Issue #24728: Fix building without threads.
Patch by Louis Dassy.
-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 */