summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-15 20:52:14 (GMT)
committerGitHub <noreply@github.com>2022-11-15 20:52:14 (GMT)
commite470803295164f0c160ccf9d0c4b0b5beab59ce0 (patch)
tree8beebb01d2b4366c8797668cdc674ceb2c77d29e /Python
parentbc2cdfc81571dc759a90b94dd3f4858b98cad1eb (diff)
downloadcpython-e470803295164f0c160ccf9d0c4b0b5beab59ce0.zip
cpython-e470803295164f0c160ccf9d0c4b0b5beab59ce0.tar.gz
cpython-e470803295164f0c160ccf9d0c4b0b5beab59ce0.tar.bz2
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
(cherry picked from commit 4e4b13e8f6211abbc0d53056da11357756daa314) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 1d5a06a..2b5c9d3 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -462,6 +462,8 @@ sys_addaudithook_impl(PyObject *module, PyObject *hook)
if (interp->audit_hooks == NULL) {
return NULL;
}
+ /* Avoid having our list of hooks show up in the GC module */
+ PyObject_GC_UnTrack(interp->audit_hooks);
}
if (PyList_Append(interp->audit_hooks, hook) < 0) {