summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-21 14:50:42 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-21 14:50:42 (GMT)
commit28f8bee5c8faf0c275665786f90e260443739cdb (patch)
tree79ae403d4b10a43243b997594686f396625dc334 /Lib/test/test_import.py
parent08c08eb93cc0b67215d1922adc55f3ebf40b5122 (diff)
downloadcpython-28f8bee5c8faf0c275665786f90e260443739cdb.zip
cpython-28f8bee5c8faf0c275665786f90e260443739cdb.tar.gz
cpython-28f8bee5c8faf0c275665786f90e260443739cdb.tar.bz2
Issue #13645: fix test_import failure when run immediately after test_coding.
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 63b8776..c695757 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -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")