mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41162: Clear audit hooks later during finalization (GH-21222)
This commit is contained in:
parent
d160e0f8e2
commit
daa0fe03a5
5 changed files with 16 additions and 45 deletions
|
@ -1291,6 +1291,13 @@ finalize_interp_clear(PyThreadState *tstate)
|
|||
_PyGC_CollectNoFail();
|
||||
}
|
||||
|
||||
/* Clear all loghooks */
|
||||
/* Both _PySys_Audit function and users still need PyObject, such as tuple.
|
||||
Call _PySys_ClearAuditHooks when PyObject available. */
|
||||
if (is_main_interp) {
|
||||
_PySys_ClearAuditHooks(tstate);
|
||||
}
|
||||
|
||||
_PyGC_Fini(tstate);
|
||||
|
||||
if (is_main_interp) {
|
||||
|
@ -1405,9 +1412,6 @@ Py_FinalizeEx(void)
|
|||
*/
|
||||
_PyGC_CollectIfEnabled();
|
||||
|
||||
/* Clear all loghooks */
|
||||
_PySys_ClearAuditHooks(tstate);
|
||||
|
||||
/* Destroy all modules */
|
||||
_PyImport_Cleanup(tstate);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue