]> 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:53:16 +0000 (15:53 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 21 Dec 2011 14:53:16 +0000 (15:53 +0100)
1  2 
Lib/test/test_import.py

index 86ef40ec77433e3df5cbe035413d9cf18cc6ca33,c69575729d68f816def2904ed63d5213de5b42ef..9f80b70284ddc4ccba9457d9ca0002467276181b
@@@ -103,9 -104,12 +103,10 @@@ class ImportTests(unittest.TestCase)
              sys.path.insert(0, os.curdir)
              try:
                  fname = TESTFN + os.extsep + "py"
 -                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))
 +                create_empty_file(fname)
-                 __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")