mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
(cherry picked from commit 4e4b13e8f6)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
bc2cdfc815
commit
e470803295
4 changed files with 20 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue