commit | ef8dc06c01e71889122d7cfb2590cde12b8a9515 | [log] [tgz] |
---|---|---|
author | Fred Drake <fdrake@acm.org> | Thu Mar 13 14:13:16 1997 +0000 |
committer | Fred Drake <fdrake@acm.org> | Thu Mar 13 14:13:16 1997 +0000 |
tree | 303d5d57266df4645ca7199ba965a7e3dfbd9695 | |
parent | 6af0c00ab671aa6e276c9bbd20b9b71d9ae96264 [diff] [blame] |
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 fba7b1d..e9e90ff 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py
@@ -19,7 +19,7 @@ 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)