summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-09 21:51:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-09 21:51:54 (GMT)
commit04c954d2754e917c037c032579ee5aa95da6529e (patch)
tree236e68f12cc76cdbf52f7fe6fd0301437f2d3bd0 /Lib/test/libregrtest
parent5486a8842717def49a592dfdae89f831aeb1277c (diff)
parent28f42fd4f813b4be15b47629c557ef8f958727cb (diff)
downloadcpython-04c954d2754e917c037c032579ee5aa95da6529e.zip
cpython-04c954d2754e917c037c032579ee5aa95da6529e.tar.gz
cpython-04c954d2754e917c037c032579ee5aa95da6529e.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.py8
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