From: Amaury Forgeot d'Arc Date: Sun, 20 Apr 2008 21:02:21 +0000 (+0000) Subject: Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains X-Git-Tag: v2.6a3~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eac43afdc9e06c5edc5ac2c19e40126a8e455bed;p=thirdparty%2FPython%2Fcpython.git Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains info for all processed zip files, even when they are no longer used. --- diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index a14f09187a51..b3fc5d84e743 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()