]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Correct an apparent refleak in test_pkgutil: zipimport._zip_directory_cache contains
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Sun, 20 Apr 2008 21:02:21 +0000 (21:02 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Sun, 20 Apr 2008 21:02:21 +0000 (21:02 +0000)
info for all processed zip files, even when they are no longer used.

Lib/test/test_pkgutil.py

index a14f09187a5156b3718267977d2300e6353ce5ce..b3fc5d84e74365f191b11a398361491943815057 100644 (file)
@@ -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()