Commit e8a6ad76 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #1728 from jdemeyer/call_one_arg_no_cyfunction

Don't use __Pyx_PyObject_CallMethO on cyfunctions
parents 78b1c068 50e7a673
......@@ -1686,11 +1686,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
return __Pyx_PyFunction_FastCall(func, &arg, 1);
}
#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
if (likely(PyCFunction_Check(func))) {
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
// fast and simple case that we are optimising for
return __Pyx_PyObject_CallMethO(func, arg);
......
# cython: binding=True
# mode: run
# tag: cyfunction
cdef class TestMethodOneArg:
def meth(self, arg):
pass
def call_meth(x):
"""
>>> call_meth(TestMethodOneArg())
Traceback (most recent call last):
...
TypeError: meth() takes exactly one argument (0 given)
"""
return x.meth()
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