diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-09 21:52:40 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-09 21:52:40 (GMT) |
commit | 1f9449589ef4aec61cdd01ee6d087d9f14213f9a (patch) | |
tree | 4f29569de175be95e309bad81f90ed7050925d79 /Lib/test/libregrtest | |
parent | ea446e2f2a7917ca094cc515cb843a5d3e97d8b2 (diff) | |
parent | 04c954d2754e917c037c032579ee5aa95da6529e (diff) | |
download | cpython-1f9449589ef4aec61cdd01ee6d087d9f14213f9a.zip cpython-1f9449589ef4aec61cdd01ee6d087d9f14213f9a.tar.gz cpython-1f9449589ef4aec61cdd01ee6d087d9f14213f9a.tar.bz2 |
Issue #28649: Clear the typing module caches when search for reference leaks.
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/refleak.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 59dc49f..3bed596 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -184,6 +184,14 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): else: ctypes._reset_cache() + try: + typing = sys.modules['typing'] + except KeyError: + pass + else: + for f in typing._cleanups: + f() + # Collect cyclic trash and read memory statistics immediately after. func1 = sys.getallocatedblocks func2 = sys.gettotalrefcount |