From ee502a08dd299cb74df3fd7567323d5fe4fae6e6 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 16 Feb 2024 09:02:35 +0100 Subject: [PATCH] Use Python 3.13a4 PyCFunctionFastWithKeywords Python 3.13a4 adds a public PyCFunctionFastWithKeywords type. * https://github.com/python/cpython/commit/9e3729bbd77fb9dcaea6a06ac760160136d80b79 * https://github.com/python/cpython/pull/114627 * https://github.com/capi-workgroup/decisions/issues/11 Python 3.13a1 removed the private _PyCFunctionFastWithKeywords type. --- Cython/Utility/CythonFunction.c | 2 +- Cython/Utility/ModuleSetupCode.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cython/Utility/CythonFunction.c b/Cython/Utility/CythonFunction.c index 2a3b67335d2..646e3f5ff3a 100644 --- a/Cython/Utility/CythonFunction.c +++ b/Cython/Utility/CythonFunction.c @@ -1019,7 +1019,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 785fcc653ef..6655e821ccf 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -908,7 +908,11 @@ class __Pyx_FakeReference { Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030D00A4 + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL