]> granicus.if.org Git - python/commitdiff
Issue #28649: Clear the typing module caches when search for reference leaks.
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 9 Nov 2016 21:49:02 +0000 (23:49 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Wed, 9 Nov 2016 21:49:02 +0000 (23:49 +0200)
Lib/test/regrtest.py

index f870854a67720e733afc128e4f9d6e2bcf15d7ba..885b14fd56f2d08473fc3a8e3fff8451eb40e406 100755 (executable)
@@ -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