Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
_Py_ClearExecutorDeletionList(interp);
#endif
_PyAST_Fini(interp);
_PyWarnings_Fini(interp);
_PyAtExit_Fini(interp);

// All Python types must be destroyed before the last GC collection. Python
Expand All @@ -815,6 +814,10 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
/* Last garbage collection on this interpreter */
_PyGC_CollectNoFail(tstate);
_PyGC_Fini(interp);

// Finalize warnings after last gc so that any finalizers can
// access warnings state
_PyWarnings_Fini(interp);
struct _PyExecutorObject *cold = interp->cold_executor;
if (cold != NULL) {
interp->cold_executor = NULL;
Expand Down
Loading