]> granicus.if.org Git - python/commitdiff
#9964: fix running test_import under -O or -OO.
authorGeorg Brandl <georg@python.org>
Thu, 14 Oct 2010 07:24:28 +0000 (07:24 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 14 Oct 2010 07:24:28 +0000 (07:24 +0000)
Lib/test/test_import.py

index 1d6939bbcb4d3e6a759d7223ba7c4edd69bedcdd..617f255a5286b68ff6e33be48c98e8984284282d 100644 (file)
@@ -520,7 +520,8 @@ class PycacheTests(unittest.TestCase):
         __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")