Skip to content

Commit e8d42b1

Browse files
vstinnerscoder
authored andcommitted
Use new PyCFunctionFastWithKeywords and PyCFunctionFast in Python 3.13a4 (GH-6003)
Python 3.13a4 adds a public PyCFunctionFastWithKeywords and PyCFunctionFast types and removes the private _PyCFunctionFastWithKeywords and _PyCFunctionFast types: * python/cpython@9e3729b * python/cpython#114627 * capi-workgroup/decisions#11
1 parent b44db63 commit e8d42b1

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Cython/Utility/CythonFunction.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
10581058
return NULL;
10591059
}
10601060

1061-
return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
1061+
return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
10621062
}
10631063

10641064
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)

Cython/Utility/ModuleSetupCode.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,13 @@ class __Pyx_FakeReference {
873873
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
874874
Py_ssize_t nargs, PyObject *kwnames);
875875
#else
876-
#define __Pyx_PyCFunctionFast _PyCFunctionFast
877-
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
876+
#if PY_VERSION_HEX >= 0x030d00A4
877+
# define __Pyx_PyCFunctionFast PyCFunctionFast
878+
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
879+
#else
880+
# define __Pyx_PyCFunctionFast _PyCFunctionFast
881+
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
882+
#endif
878883
#endif
879884

880885
#if CYTHON_METH_FASTCALL

0 commit comments

Comments
 (0)