[Python-checkins] cpython (2.7): backout 369bf9fbaeff

benjamin.peterson python-checkins at python.org
Sun Feb 16 20:54:06 CET 2014


http://hg.python.org/cpython/rev/47394ceeaba1
changeset:   89226:47394ceeaba1
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Feb 16 14:51:17 2014 -0500
summary:
  backout 369bf9fbaeff

files:
  Lib/test/regrtest.py     |  11 ++++-------
  Lib/test/test_pkgutil.py |   4 +++-
  2 files changed, 7 insertions(+), 8 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1002,10 +1002,9 @@
     try:
         import zipimport
     except ImportError:
-        zsc = zdc = None # Run unmodified on platforms without zipimport support
+        zdc = None # Run unmodified on platforms without zipimport support
     else:
         zdc = zipimport._zip_directory_cache.copy()
-        zsc = zipimport._zip_stat_cache.copy()
     abcs = {}
     modules = _abcoll, _pyio
     for abc in [getattr(mod, a) for mod in modules for a in mod.__all__]:
@@ -1028,12 +1027,12 @@
     repcount = nwarmup + ntracked
     print >> sys.stderr, "beginning", repcount, "repetitions"
     print >> sys.stderr, ("1234567890"*(repcount//10 + 1))[:repcount]
-    dash_R_cleanup(fs, ps, pic, zdc, zsc, abcs)
+    dash_R_cleanup(fs, ps, pic, zdc, abcs)
     for i in range(repcount):
         rc_before = sys.gettotalrefcount()
         run_the_test()
         sys.stderr.write('.')
-        dash_R_cleanup(fs, ps, pic, zdc, zsc, abcs)
+        dash_R_cleanup(fs, ps, pic, zdc, abcs)
         rc_after = sys.gettotalrefcount()
         if i >= nwarmup:
             deltas.append(rc_after - rc_before)
@@ -1047,7 +1046,7 @@
         return True
     return False
 
-def dash_R_cleanup(fs, ps, pic, zdc, zsc, abcs):
+def dash_R_cleanup(fs, ps, pic, zdc, abcs):
     import gc, copy_reg
     import _strptime, linecache
     dircache = test_support.import_module('dircache', deprecated=True)
@@ -1073,8 +1072,6 @@
     else:
         zipimport._zip_directory_cache.clear()
         zipimport._zip_directory_cache.update(zdc)
-        zipimport._zip_stat_cache.clear()
-        zipimport._zip_stat_cache.update(zsc)
 
     # clear type cache
     sys._clear_type_cache()
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -133,7 +133,9 @@
 
 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()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list