Skip to content

Commit 55c1435

Browse files
committed
fix building without threads (closes python#23877)
1 parent 3fbcafa commit 55c1435

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Python/pylifecycle.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,12 @@ _Py_PrintFatalError(int fd)
12991299
return;
13001300

13011301
display_stack:
1302+
#ifdef WITH_THREAD
13021303
/* PyGILState_GetThisThreadState() works even if the GIL was released */
13031304
tstate = PyGILState_GetThisThreadState();
1305+
#else
1306+
tstate = PyThreadState_GET();
1307+
#endif
13041308
if (tstate == NULL) {
13051309
/* _Py_DumpTracebackThreads() requires the thread state to display
13061310
* frames */

0 commit comments

Comments
 (0)