From eac43afdc9e06c5edc5ac2c19e40126a8e455bed Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Sun, 20 Apr 2008 21:02:21 +0000 Subject: 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. --- Lib/test/test_pkgutil.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index a14f091..b3fc5d8 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() -- cgit v0.12