Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deprecated Py_OptimizeFlag in Py3.12 #5343

Merged
merged 2 commits into from Mar 31, 2023

Conversation

scoder
Copy link
Contributor

@scoder scoder commented Mar 28, 2023

Work around the deprecation of Py_OptimizeFlag in Py3.12 by reading the value from the interpreter's current PyConfig.

This is probably less efficient than was originally intended and makes assertions a little more costly.

See python/cpython#99872

…the old Py_OptimizeFlag. The flag was never meant to be modifiable and thus can be read once at module import time.

See python/cpython#99872 (comment)
@scoder scoder merged commit dacb26c into cython:master Mar 31, 2023
69 checks passed
scoder added a commit that referenced this pull request May 24, 2023
* Work around the deprecation of Py_OptimizeFlag in Py3.12 by reading the value from the interpreter's current PyConfig.

See python/cpython#99872

* Avoid access to PyConfig without holding the GIL when trying to read the old Py_OptimizeFlag. The flag was never meant to be modifiable and thus can be read once at module import time.

See python/cpython#99872 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant