diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-11 07:03:05 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-11 07:03:05 (GMT) |
commit | 3540b508844353add804a1ed48e0a73469c385ca (patch) | |
tree | 31fad361d7f299011bcb98613b325d66d9d5635c /Lib/test/test_import.py | |
parent | 61ecb7768ff04e9918a461a5b4aa692580c9e113 (diff) | |
download | cpython-3540b508844353add804a1ed48e0a73469c385ca.zip cpython-3540b508844353add804a1ed48e0a73469c385ca.tar.gz cpython-3540b508844353add804a1ed48e0a73469c385ca.tar.bz2 |
Good catch Neal!
I completely forgot about pyo files and the tests are usually not run with -O. The modified code checks for *.py?
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r-- | Lib/test/test_import.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index d8f2d51..6eac67e 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -213,7 +213,8 @@ class ImportTest(unittest.TestCase): os.remove(source) del sys.modules[TESTFN] mod = __import__(TESTFN) - self.failUnless(mod.__file__.endswith('.pyc')) + ext = mod.__file__[-4:] + self.failUnless(ext in ('.pyc', '.pyo'), ext) finally: sys.path.pop(0) remove_files(TESTFN) |