From: Georg Brandl Date: Thu, 14 Oct 2010 07:24:28 +0000 (+0000) Subject: #9964: fix running test_import under -O or -OO. X-Git-Tag: v3.2a4~606 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb3c84a8d9974a49c0008a1832a9c9a3d001c4b4;p=python #9964: fix running test_import under -O or -OO. --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 1d6939bbcb..617f255a52 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -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")