[Python-checkins] cpython (3.2): Issue #13645: fix test_import failure when run immediately after test_coding.

antoine.pitrou python-checkins at python.org
Wed Dec 21 15:54:00 CET 2011


http://hg.python.org/cpython/rev/f4afc6858ed2
changeset:   74112:f4afc6858ed2
branch:      3.2
parent:      74108:19df72a77b39
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Dec 21 15:50:42 2011 +0100
summary:
  Issue #13645: fix test_import failure when run immediately after test_coding.

files:
  Lib/test/test_import.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -107,8 +107,9 @@
                 open(fname, 'w').close()
                 os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |
                                  stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))
+                fn = imp.cache_from_source(fname)
+                unlink(fn)
                 __import__(TESTFN)
-                fn = imp.cache_from_source(fname)
                 if not os.path.exists(fn):
                     self.fail("__import__ did not result in creation of "
                               "either a .pyc or .pyo file")

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


More information about the Python-checkins mailing list