Skip to content

Commit 79f7cd3

Browse files
committed
Fix test_embed.test_no_memleak()
1 parent 96cdc6c commit 79f7cd3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/pylifecycle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,8 +2118,9 @@ finalize_interp_clear(PyThreadState *tstate)
21182118
_PyExc_ClearExceptionGroupType(interp);
21192119
_Py_clear_generic_types(interp);
21202120
_PyTypes_FiniCachedDescriptors(interp);
2121+
_PySys_Fini(interp);
21212122

2122-
/* Clear interpreter state and all thread states */
2123+
/* Clear interpreter state and all thread states: last GC collection! */
21232124
_PyInterpreterState_Clear(tstate);
21242125

21252126
/* Clear all loghooks */
@@ -2137,7 +2138,6 @@ finalize_interp_clear(PyThreadState *tstate)
21372138
}
21382139

21392140
finalize_interp_types(interp);
2140-
_PySys_Fini(interp);
21412141

21422142
/* Finalize dtoa at last so that finalizers calling repr of float doesn't crash */
21432143
_PyDtoa_Fini(interp);

0 commit comments

Comments
 (0)