mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -19,7 +19,7 @@ def compile(file, cfile = None):
|
||||||
timestamp = long(os.stat(file)[8])
|
timestamp = long(os.stat(file)[8])
|
||||||
codeobject = __builtin__.compile(codestring, file, 'exec')
|
codeobject = __builtin__.compile(codestring, file, 'exec')
|
||||||
if not cfile:
|
if not cfile:
|
||||||
cfile = file + 'c'
|
cfile = file + (__debug__ and 'c' or 'o')
|
||||||
fc = open(cfile, 'wb')
|
fc = open(cfile, 'wb')
|
||||||
fc.write(MAGIC)
|
fc.write(MAGIC)
|
||||||
wr_long(fc, timestamp)
|
wr_long(fc, timestamp)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue