Commit e649d770 authored by Ronan Lamy's avatar Ronan Lamy

Fix classmethod creation for (upcoming) PyPy{,3} 5.9

parent 5c9cbb61
...@@ -1216,14 +1216,14 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/ ...@@ -1216,14 +1216,14 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
//////////////////// ClassMethod //////////////////// //////////////////// ClassMethod ////////////////////
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
// cdef classes // cdef classes
return PyClassMethod_New(method); return PyClassMethod_New(method);
} }
#else #else
#if CYTHON_COMPILING_IN_PYSTON #if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY
// special C-API function only in Pyston // special C-API function only in Pyston and PyPy >= 5.9
if (PyMethodDescr_Check(method)) { if (PyMethodDescr_Check(method)) {
#else #else
// It appears that PyMethodDescr_Type is not exposed anywhere in the CPython C-API // It appears that PyMethodDescr_Type is not exposed anywhere in the CPython C-API
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment