Skip to content

freeze uses deprecated global Py_OptimizeFlag #116114

Open
@chris21k

Description

@chris21k

Bug report

Bug description:

freeze, i.e., makefreeze.py uses a dreprecated syntax using Py_OptimizeFlag++; instead of newer PyConfig syntax. The C compiler throws a warning for that.
As a bold guess to fix this, the in Python embedded C code may, e.g., be updated to somthing like the following:

// Py_OptimizeFlag++;
PyConfig config;
PyConfig_InitPythonConfig(&config);
config.optimization_level++;
Py_InitializeFromConfig(&config);
PyConfig_Clear(&config);

Thanks,
Chris

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions