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)
This commit is contained in:
Guido van Rossum 1998-04-23 14:39:05 +00:00
parent df1940717d
commit 1abfb9c0f5
1 changed files with 4 additions and 0 deletions

View File

@ -14,12 +14,16 @@
}; };
""" """
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen app.
default_entry_point = """ default_entry_point = """
int int
main(argc, argv) main(argc, argv)
int argc; int argc;
char **argv; char **argv;
{ {
""" + ((not __debug__ and """
Py_OptimizeFlag++;
""") or "") + """
PyImport_FrozenModules = _PyImport_FrozenModules; PyImport_FrozenModules = _PyImport_FrozenModules;
return Py_FrozenMain(argc, argv); return Py_FrozenMain(argc, argv);
} }