changeset: 105027:d926b484d33a branch: 3.5 parent: 105024:d920bfa5a71a user: Serhiy Storchaka date: Wed Nov 09 23:49:02 2016 +0200 files: Lib/test/regrtest.py description: Issue #28649: Clear the typing module caches when search for reference leaks. diff -r d920bfa5a71a -r d926b484d33a Lib/test/regrtest.py --- a/Lib/test/regrtest.py Wed Nov 09 13:23:04 2016 -0800 +++ b/Lib/test/regrtest.py Wed Nov 09 23:49:02 2016 +0200 @@ -1526,6 +1526,14 @@ 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