Commit 8ac1a6a5 authored by Stefan Behnel's avatar Stefan Behnel

Allow (and ignore) empty defines of Py_TPFLAGS_METHOD_DESCRIPTOR.

parent 37070f3d
...@@ -1485,10 +1485,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me ...@@ -1485,10 +1485,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me
descr = _PyType_Lookup(tp, name); descr = _PyType_Lookup(tp, name);
if (likely(descr != NULL)) { if (likely(descr != NULL)) {
Py_INCREF(descr); Py_INCREF(descr);
// Repeating the condition below accommodates for MSVC's inability to test macros inside of macro expansions. #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
if (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) if (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3 #elif PY_MAJOR_VERSION >= 3
// Repeating the condition below accommodates for MSVC's inability to test macros inside of macro expansions.
#ifdef __Pyx_CyFunction_USED #ifdef __Pyx_CyFunction_USED
if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
#else #else
......
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