diff -r c59d81b802f8 Lib/test/test_py_compile.py --- a/Lib/test/test_py_compile.py Tue Mar 31 16:35:35 2015 +0200 +++ b/Lib/test/test_py_compile.py Tue Mar 31 18:04:05 2015 +0300 @@ -105,14 +105,15 @@ class PyCompileTests(unittest.TestCase): # py_compile foo.bar.py -> __pycache__/foo.cpython-34.pyc weird_path = os.path.join(self.directory, 'foo.bar.py') cache_path = importlib.util.cache_from_source(weird_path) - pyc_path = weird_path + 'c' + pyc_path = weird_path + ('c' if __debug__ else 'o') head, tail = os.path.split(cache_path) penultimate_tail = os.path.basename(head) self.assertEqual( os.path.join(penultimate_tail, tail), os.path.join( '__pycache__', - 'foo.bar.{}.pyc'.format(sys.implementation.cache_tag))) + 'foo.bar.{}.py{}'.format(sys.implementation.cache_tag, + ('c' if __debug__ else 'o')))) with open(weird_path, 'w') as file: file.write('x = 123\n') py_compile.compile(weird_path)