diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2023-05-02 08:59:20 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2023-05-02 08:59:20 +0200 |
commit | 4fa1f93b6e9a32bb384400b1dee1da0fe0262eca (patch) | |
tree | 2874c16b8bb013bf66f14a80e81fbe5a9b907bc1 | |
parent | 755c4944203316fab2b179afb326177ec3b71119 (diff) | |
download | cython-4fa1f93b6e9a32bb384400b1dee1da0fe0262eca.tar.gz |
Allow users to override CYTHON_PEP489_MULTI_PHASE_INIT in PyPy 3.9+.
See https://github.com/cython/cython/issues/5413
Improves on https://github.com/cython/cython/pull/5414
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 9a126b3ea..c7e94c869 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -158,11 +158,11 @@ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #if PY_VERSION_HEX >= 0x03090000 - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #else + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 |