Support optimize flag

This commit is contained in:
Justine Tunney 2021-08-17 14:07:59 -07:00
parent cabb0a7ede
commit c70422586a

View file

@ -160,7 +160,7 @@ main(int argc, char *argv[])
Py_SetProgramName(gc(utf8toutf32(argv[0], -1, 0))); Py_SetProgramName(gc(utf8toutf32(argv[0], -1, 0)));
_Py_InitializeEx_Private(1, 0); _Py_InitializeEx_Private(1, 0);
name = gc(xjoinpaths(".python", StripComponents(inpath, 3))); name = gc(xjoinpaths(".python", StripComponents(inpath, 3)));
code = Py_CompileStringExFlags(p, name, Py_file_input, NULL, 0); code = Py_CompileStringExFlags(p, name, Py_file_input, NULL, optimize);
if (!code) goto error; if (!code) goto error;
marshalled = PyMarshal_WriteObjectToString(code, Py_MARSHAL_VERSION); marshalled = PyMarshal_WriteObjectToString(code, Py_MARSHAL_VERSION);
Py_CLEAR(code); Py_CLEAR(code);