From: Serhiy Storchaka Date: Wed, 9 Nov 2016 21:49:02 +0000 (+0200) Subject: Issue #28649: Clear the typing module caches when search for reference leaks. X-Git-Tag: v3.6.0b4~109^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28f42fd4f813b4be15b47629c557ef8f958727cb;p=thirdparty%2FPython%2Fcpython.git Issue #28649: Clear the typing module caches when search for reference leaks. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index f870854a6772..885b14fd56f2 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