Issue #13645: fix test_import failure when run immediately after test_coding.

This commit is contained in:
Antoine Pitrou 2011-12-21 15:53:16 +01:00
commit f0a49a9e27

View file

@ -104,8 +104,9 @@ class ImportTests(unittest.TestCase):
try:
fname = TESTFN + os.extsep + "py"
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")