From 0bd5fb0112b26310cc9db8ac92ce6936385be26c Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 27 Jul 2015 16:46:11 +0300 Subject: Issue #24728: Fix building without threads. Patch by Louis Dassy. --- Python/pythonrun.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/pythonrun.c') 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 */ -- cgit v1.2.1