Skip to content

Commit b6dccf5

Browse files
authored
bpo-33612: Remove PyThreadState_Clear() assertion (#7069)
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear() which failed at Python shutdown or on fork if a thread was running a generator.
1 parent 825aab9 commit b6dccf5

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

Python/pystate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ PyThreadState_Clear(PyThreadState *tstate)
586586
Py_CLEAR(tstate->exc_state.exc_traceback);
587587

588588
/* The stack of exception states should contain just this thread. */
589-
assert(tstate->exc_info->previous_item == NULL);
590589
if (Py_VerboseFlag && tstate->exc_info != &tstate->exc_state) {
591590
fprintf(stderr,
592591
"PyThreadState_Clear: warning: thread still has a generator\n");

0 commit comments

Comments
 (0)