[Python-checkins] r85460 - python/branches/py3k/Lib/test/test_import.py

georg.brandl python-checkins at python.org
Thu Oct 14 09:24:28 CEST 2010


Author: georg.brandl
Date: Thu Oct 14 09:24:28 2010
New Revision: 85460

Log:
#9964: fix running test_import under -O or -OO.

Modified:
   python/branches/py3k/Lib/test/test_import.py

Modified: python/branches/py3k/Lib/test/test_import.py
==============================================================================
--- python/branches/py3k/Lib/test/test_import.py	(original)
+++ python/branches/py3k/Lib/test/test_import.py	Thu Oct 14 09:24:28 2010
@@ -520,7 +520,8 @@
         __import__(TESTFN)
         self.assertTrue(os.path.exists('__pycache__'))
         self.assertTrue(os.path.exists(os.path.join(
-            '__pycache__', '{}.{}.pyc'.format(TESTFN, self.tag))))
+            '__pycache__', '{}.{}.py{}'.format(
+            TESTFN, self.tag, sys.flags.optimize and 'o' or 'c'))))
 
     @unittest.skipUnless(os.name == 'posix',
                          "test meaningful only on posix systems")


More information about the Python-checkins mailing list