diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index a14f09187a5..b3fc5d84e74 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -122,6 +122,9 @@ class PkgutilPEP302Tests(unittest.TestCase): def test_main(): run_unittest(PkgutilTests, PkgutilPEP302Tests) + # this is necessary if test is run repeated (like when finding leaks) + import zipimport + zipimport._zip_directory_cache.clear() if __name__ == '__main__': test_main()