summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-07-04 00:04:22 +0100
committerGitHub <noreply@github.com>2020-07-04 00:04:22 +0100
commitb9e288cc1bfd583e887f784e38d9c511b43c0c3a (patch)
tree7fedd13907d72e5b3ccd862a05a15cac9ecc577b /Python
parentc1d916595eb6979d4d87cc3e5216e26b3c6fac25 (diff)
downloadcpython-git-b9e288cc1bfd583e887f784e38d9c511b43c0c3a.tar.gz
bpo-41162: Clear audit hooks later during finalization (GH-21222)
Co-authored-by: Konge <zkonge@outlook.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 27cebf33da..dc2d13db41 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1229,13 +1229,6 @@ Py_FinalizeEx(void)
/* nothing */;
#endif
- /* Clear all loghooks */
- /* We want minimal exposure of this function, so define the extern
- * here. The linker should discover the correct function without
- * exporting a symbol. */
- extern void _PySys_ClearAuditHooks(void);
- _PySys_ClearAuditHooks();
-
/* Destroy all modules */
PyImport_Cleanup();
@@ -1306,6 +1299,13 @@ Py_FinalizeEx(void)
/* Clear interpreter state and all thread states. */
PyInterpreterState_Clear(interp);
+ /* Clear all loghooks */
+ /* We want minimal exposure of this function, so define the extern
+ * here. The linker should discover the correct function without
+ * exporting a symbol. */
+ extern void _PySys_ClearAuditHooks(void);
+ _PySys_ClearAuditHooks();
+
/* Now we decref the exception classes. After this point nothing
can raise an exception. That's okay, because each Fini() method
below has been checked to make sure no exceptions are ever