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

Skip to content

Commit 1abfb9c

Browse files
committed
If freezing with the -O option, the optimized bytecode files are
used. It is useful to implicitly set the -O flag in the frozen application. (Sjoerd Mullender)
1 parent df19407 commit 1abfb9c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Tools/freeze/makefreeze.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
};
1515
"""
1616

17+
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen app.
1718
default_entry_point = """
1819
int
1920
main(argc, argv)
2021
int argc;
2122
char **argv;
2223
{
24+
""" + ((not __debug__ and """
25+
Py_OptimizeFlag++;
26+
""") or "") + """
2327
PyImport_FrozenModules = _PyImport_FrozenModules;
2428
return Py_FrozenMain(argc, argv);
2529
}

0 commit comments

Comments
 (0)