From ef8dc06c01e71889122d7cfb2590cde12b8a9515 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 13 Mar 1997 14:13:16 +0000 Subject: [PATCH] compile(): Use the __debug__ flag to determine the proper filename extension to use for the cached module code object. --- Lib/py_compile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/py_compile.py b/Lib/py_compile.py index fba7b1d51d..e9e90ff6ef 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -19,7 +19,7 @@ def compile(file, cfile = None): timestamp = long(os.stat(file)[8]) codeobject = __builtin__.compile(codestring, file, 'exec') if not cfile: - cfile = file + 'c' + cfile = file + (__debug__ and 'c' or 'o') fc = open(cfile, 'wb') fc.write(MAGIC) wr_long(fc, timestamp) -- 2.50.0