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 09:04:45 +0200 |
commit | b774109f7c54d7b5c25991f45649abc19871c5cd (patch) | |
tree | 44e93a63928731643bd1a829b17e2ba044aed781 | |
parent | a27f7bc48d9212171f35d692dcdedfa8f8c85df4 (diff) | |
download | cython-b774109f7c54d7b5c25991f45649abc19871c5cd.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 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 20f88d07b..13bc7a8b3 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -76,10 +76,11 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #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_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 |