mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
This commit is contained in:
parent
3d9431983a
commit
4e4b13e8f6
4 changed files with 20 additions and 0 deletions
|
@ -450,6 +450,17 @@ def test_syslog():
|
|||
syslog.closelog()
|
||||
|
||||
|
||||
def test_not_in_gc():
|
||||
import gc
|
||||
|
||||
hook = lambda *a: None
|
||||
sys.addaudithook(hook)
|
||||
|
||||
for o in gc.get_objects():
|
||||
if isinstance(o, list):
|
||||
assert hook not in o
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from test.support import suppress_msvcrt_asserts
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue