Skip to content

Commit 29a04b7

Browse files
committed
Fix frame termination
1 parent 664d439 commit 29a04b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Python/pylifecycle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ Py_EndInterpreter(PyThreadState *tstate)
25712571
if (tstate != _PyThreadState_GET()) {
25722572
Py_FatalError("thread is not current");
25732573
}
2574-
if (tstate->current_frame != NULL) {
2574+
if (tstate->current_frame != tstate->base_frame) {
25752575
Py_FatalError("thread still has a frame");
25762576
}
25772577
interp->finalizing = 1;

Python/pystate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ PyThreadState_Clear(PyThreadState *tstate)
16841684

16851685
int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose;
16861686

1687-
if (verbose && tstate->current_frame != NULL) {
1687+
if (verbose && tstate->current_frame != tstate->base_frame) {
16881688
/* bpo-20526: After the main thread calls
16891689
_PyInterpreterState_SetFinalizing() in Py_FinalizeEx()
16901690
(or in Py_EndInterpreter() for subinterpreters),

0 commit comments

Comments
 (0)