fix building without threads (closes #23877)

This commit is contained in:
Benjamin Peterson 2015-04-06 09:59:23 -04:00
parent 3fbcafa476
commit 55c14355ac
1 changed files with 4 additions and 0 deletions

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