Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef8dc06

Browse files
committed
compile(): Use the __debug__ flag to determine the proper filename extension
to use for the cached module code object.
1 parent 6af0c00 commit ef8dc06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/py_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def compile(file, cfile = None):
1919
timestamp = long(os.stat(file)[8])
2020
codeobject = __builtin__.compile(codestring, file, 'exec')
2121
if not cfile:
22-
cfile = file + 'c'
22+
cfile = file + (__debug__ and 'c' or 'o')
2323
fc = open(cfile, 'wb')
2424
fc.write(MAGIC)
2525
wr_long(fc, timestamp)

0 commit comments

Comments
 (0)