bpo-21222: Fix improperly merged change so that final hooks are called before types are cleared (GH-21304)

This commit is contained in:
Steve Dower 2020-07-03 23:34:46 +01:00 committed by GitHub
parent e1d4fdc533
commit 941117aaa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1301,8 +1301,6 @@ finalize_interp_clear(PyThreadState *tstate)
_PyGC_CollectNoFail(); _PyGC_CollectNoFail();
} }
finalize_interp_types(tstate, is_main_interp);
/* Clear all loghooks */ /* Clear all loghooks */
/* Both _PySys_Audit function and users still need PyObject, such as tuple. /* Both _PySys_Audit function and users still need PyObject, such as tuple.
Call _PySys_ClearAuditHooks when PyObject available. */ Call _PySys_ClearAuditHooks when PyObject available. */
@ -1310,6 +1308,8 @@ finalize_interp_clear(PyThreadState *tstate)
_PySys_ClearAuditHooks(tstate); _PySys_ClearAuditHooks(tstate);
} }
finalize_interp_types(tstate, is_main_interp);
if (is_main_interp) { if (is_main_interp) {
/* XXX Still allocated: /* XXX Still allocated:
- various static ad-hoc pointers to interned strings - various static ad-hoc pointers to interned strings