]> granicus.if.org Git - python/commitdiff
Issue #13645: fix test_import failure when run immediately after test_coding.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 21 Dec 2011 14:50:42 +0000 (15:50 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 21 Dec 2011 14:50:42 +0000 (15:50 +0100)
Lib/test/test_import.py

index 63b8776e7769e31f08f04d39b0caf7d0d4c7daab..c69575729d68f816def2904ed63d5213de5b42ef 100644 (file)
@@ -107,8 +107,9 @@ class ImportTests(unittest.TestCase):
                 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))
-                __import__(TESTFN)
                 fn = imp.cache_from_source(fname)
+                unlink(fn)
+                __import__(TESTFN)
                 if not os.path.exists(fn):
                     self.fail("__import__ did not result in creation of "
                               "either a .pyc or .pyo file")