diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-09 21:49:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-09 21:49:02 (GMT) |
commit | 28f42fd4f813b4be15b47629c557ef8f958727cb (patch) | |
tree | 6544940762a4d95c4aeeb9270657d0f418cf66b4 | |
parent | 9b107560191085a0c5462ad878e1e9eeae94ba82 (diff) | |
download | cpython-28f42fd4f813b4be15b47629c557ef8f958727cb.zip cpython-28f42fd4f813b4be15b47629c557ef8f958727cb.tar.gz cpython-28f42fd4f813b4be15b47629c557ef8f958727cb.tar.bz2 |
Issue #28649: Clear the typing module caches when search for reference leaks.
-rwxr-xr-x | Lib/test/regrtest.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index f870854..885b14f 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1526,6 +1526,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 |