(original) (raw)
changeset: 74112:f4afc6858ed2 branch: 3.2 parent: 74108:19df72a77b39 user: Antoine Pitrou solipsis@pitrou.net date: Wed Dec 21 15:50:42 2011 +0100 files: Lib/test/test_import.py description: Issue #13645: fix test_import failure when run immediately after test_coding. diff -r 19df72a77b39 -r f4afc6858ed2 Lib/test/test_import.py --- a/Lib/test/test_import.py Wed Dec 21 11:24:15 2011 +0100 +++ b/Lib/test/test_import.py Wed Dec 21 15:50:42 2011 +0100 @@ -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") /solipsis@pitrou.net