mirror of https://github.com/python/cpython
compile(): Use the __debug__ flag to determine the proper filename extension
to use for the cached module code object.
This commit is contained in:
parent
6af0c00ab6
commit
ef8dc06c01
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue