diff options
author | scoder <stefan_ml@behnel.de> | 2023-03-31 20:00:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 20:00:12 +0200 |
commit | dacb26cec739a2afa2ba9d305f05504168612bf8 (patch) | |
tree | e145ff47cf5c00f9d8549e446dee4f01518e4701 /Cython/Utility/ModuleSetupCode.c | |
parent | f7c073ff83e7489e32f1264c6837f38555a62e5b (diff) | |
download | cython-dacb26cec739a2afa2ba9d305f05504168612bf8.tar.gz |
Avoid deprecated Py_OptimizeFlag in Py3.12 (GH-5343)
* Work around the deprecation of Py_OptimizeFlag in Py3.12 by reading the value from the interpreter's current PyConfig.
See https://github.com/python/cpython/issues/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 https://github.com/python/cpython/issues/99872#issuecomment-1333763465
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 950d89a67..f85370f44 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -613,10 +613,6 @@ class __Pyx_FakeReference { /////////////// PythonCompatibility /////////////// -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif - #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" |