Skip to content

Commit 926e45d

Browse files
committed
Remove assertion in PyThreadState_Clear().
1 parent e3d9bd6 commit 926e45d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/pystate.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,11 @@ PyThreadState_Clear(PyThreadState *tstate)
16251625
{
16261626
assert(tstate->_status.initialized && !tstate->_status.cleared);
16271627
assert(current_fast_get()->interp == tstate->interp);
1628-
assert(!_PyThreadState_IsRunningMain(tstate));
1628+
// GH-126016: In the _interpreters module, KeyboardInterrupt exceptions
1629+
// during PyEval_EvalCode() are sent to finalization, which doesn't let us
1630+
// mark threads as "not running main". So, for now this assertion is
1631+
// disabled.
1632+
// XXX assert(!_PyThreadState_IsRunningMain(tstate));
16291633
// XXX assert(!tstate->_status.bound || tstate->_status.unbound);
16301634
tstate->_status.finalizing = 1; // just in case
16311635

0 commit comments

Comments
 (0)