summaryrefslogtreecommitdiff
path: root/Lib/py_compile.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1997-03-13 14:13:16 +0000
committerFred Drake <fdrake@acm.org>1997-03-13 14:13:16 +0000
commitef8dc06c01e71889122d7cfb2590cde12b8a9515 (patch)
tree303d5d57266df4645ca7199ba965a7e3dfbd9695 /Lib/py_compile.py
parent6af0c00ab671aa6e276c9bbd20b9b71d9ae96264 (diff)
downloadcpython-git-ef8dc06c01e71889122d7cfb2590cde12b8a9515.tar.gz
compile(): Use the __debug__ flag to determine the proper filename extension
to use for the cached module code object.
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r--Lib/py_compile.py2
1 files changed, 1 insertions, 1 deletions
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)