Skip to content

Py_OptimizeFlag not set correctly during Python initialization #186

@ydder007

Description

@ydder007

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions