Hi there,
we recently switched to Python 3.11 / py2exe 0.13.0.0 and noticed the optimization Flag is not set correctly in our production environment when executing external Python scripts within our application.
I tracked the issue down to the latest changes to the Python initialization in start.c.
It looks like the PyConfig_InitIsolatedConfig(&config) command does not take the previously set Py_OptimizeFlag into account when initializing the config.
I did a quick fix and added config.optimization_level = p_script_info->optimize; as a workaround until we get an official py2exe release.
Hi there,
we recently switched to Python 3.11 /
py2exe 0.13.0.0and noticed the optimization Flag is not set correctly in our production environment when executing external Python scripts within our application.I tracked the issue down to the latest changes to the Python initialization in
start.c.It looks like the
PyConfig_InitIsolatedConfig(&config)command does not take the previously setPy_OptimizeFlaginto account when initializing the config.I did a quick fix and added
config.optimization_level = p_script_info->optimize;as a workaround until we get an official py2exe release.