From fb3c84a8d9974a49c0008a1832a9c9a3d001c4b4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 14 Oct 2010 07:24:28 +0000 Subject: [PATCH] #9964: fix running test_import under -O or -OO. --- Lib/test/test_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") -- 2.49.0