summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2023-03-07 08:43:06 +0100
committerStefan Behnel <stefan_ml@behnel.de>2023-03-07 08:43:06 +0100
commit3397705da036bb2df4a5b8b4bf08dbad7bdb409f (patch)
tree9830fea29c793c89156d04ef5bda9ecd16d89e31
parent23dabe42bdd63d5971a5e0369e23745a36040e1f (diff)
downloadcython-3397705da036bb2df4a5b8b4bf08dbad7bdb409f.tar.gz
Stop using PyLong internals and dict versioning in Py3.12 for 0.29.x (handled differently in master).
-rw-r--r--Cython/Utility/ModuleSetupCode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 33aac2c4a..e8fe62be0 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -208,7 +208,8 @@
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
- #define CYTHON_USE_PYLONG_INTERNALS 1
+ // PyLong internals changed in Py3.12.
+ #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
@@ -252,7 +253,8 @@
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
#endif
#ifndef CYTHON_USE_DICT_VERSIONS
- #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
+ // The dict version field is now deprecated in Py3.12.
+ #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
#endif
#if PY_VERSION_HEX >= 0x030B00A4
#undef CYTHON_USE_EXC_INFO_STACK