Skip to content

Commit f19e28d

Browse files
committed
Add another assertion.
1 parent 6551bfa commit f19e28d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Python/pylifecycle.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,7 @@ resolve_final_tstate(_PyRuntimeState *runtime)
19941994
}
19951995
else {
19961996
/* Fall back to the current tstate. It's better than nothing. */
1997+
// XXX No it's not
19971998
main_tstate = tstate;
19981999
}
19992000
}
@@ -2018,6 +2019,8 @@ _Py_Finalize(_PyRuntimeState *runtime)
20182019

20192020
/* Get final thread state pointer. */
20202021
PyThreadState *tstate = resolve_final_tstate(runtime);
2022+
// We must be in the main interpreter
2023+
assert(tstate->interp == &runtime->_main_interpreter);
20212024

20222025
// Block some operations.
20232026
tstate->interp->finalizing = 1;

0 commit comments

Comments
 (0)