Issue #24728: Fix building without threads.

Patch by Louis Dassy.
This commit is contained in:
Berker Peksag 2015-07-27 16:46:11 +03:00
parent ddc7440b0e
commit 0bd5fb0112
1 changed files with 4 additions and 0 deletions

View 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 */