From a27f7bc48d9212171f35d692dcdedfa8f8c85df4 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Tue, 2 May 2023 09:07:46 +0300 Subject: Use CYTHON_PEP489_MULTI_PHASE_INIT on PyPy 3.9 (GH-5414) --- Cython/Utility/ModuleSetupCode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index e8fe62be0..20f88d07b 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -76,8 +76,11 @@ #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #if PY_VERSION_HEX >= 0x03090000 + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #else + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #endif #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS -- cgit v1.2.1 From b774109f7c54d7b5c25991f45649abc19871c5cd Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 2 May 2023 08:59:20 +0200 Subject: 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 --- Cython/Utility/ModuleSetupCode.c | 7 ++++--- 1 file 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 -- cgit v1.2.1 From 6a901e1256d85695bc98808795c4b53badfedfc8 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 2 May 2023 09:04:21 +0200 Subject: Update changelog. --- CHANGES.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 89075c671..a8746d0ac 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,16 @@ Bugs fixed * Some C compile failures in CPython 3.12 were resolved. +* A C compile failure in PyPy 3.10 was resolved. + Patch by Matti Picus. (Github issue :issue:`5408`) + +* Cython modules now use PEP-489 multi-phase init by default in PyPy 3.9 and later. + Original patch by Matti Picus. (Github issue :issue:`5413`) + +* API header files generated by different Cython versions can now be included in the + same C file. + (Github issue :issue:`5383`) + * Function signatures containing a type like `tuple[()]` could not be printed. Patch by Lisandro Dalcin. (Github issue :issue:`5355`) -- cgit v1.2.1