From: Fred Drake Date: Thu, 13 Mar 1997 14:13:16 +0000 (+0000) Subject: compile(): Use the __debug__ flag to determine the proper filename extension X-Git-Tag: v1.5a1~292 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef8dc06c01e71889122d7cfb2590cde12b8a9515;p=python compile(): Use the __debug__ flag to determine the proper filename extension to use for the cached module code object. --- 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)