diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-11-15 21:10:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 21:10:27 (GMT) |
commit | f4cb8285ba7c6c71fdb459fba53e877c1678e1ab (patch) | |
tree | ee9e4df6acdce788f20f3560786df1792938bb30 /Python/sysmodule.c | |
parent | e1e8a15abfa54b0801b4c5978d2b531494260a96 (diff) | |
download | cpython-f4cb8285ba7c6c71fdb459fba53e877c1678e1ab.zip cpython-f4cb8285ba7c6c71fdb459fba53e877c1678e1ab.tar.gz cpython-f4cb8285ba7c6c71fdb459fba53e877c1678e1ab.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/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 6f703e3..0ecfd77 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -440,6 +440,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) { |