Skip to content

Commit d47b6de

Browse files
committed
Merge pull request numpy#4106 from juliantaylor/objargs
ENH: use PyObject_CallFunctionObjArgs in Generic*Function
2 parents 056ab73 + 6b05a67 commit d47b6de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

numpy/core/src/multiarray/number.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ PyArray_GenericBinaryFunction(PyArrayObject *m1, PyObject *m2, PyObject *op)
299299
}
300300
}
301301

302-
return PyObject_CallFunction(op, "OO", m1, m2);
302+
return PyObject_CallFunctionObjArgs(op, m1, m2, NULL);
303303
}
304304

305305
NPY_NO_EXPORT PyObject *
@@ -309,7 +309,7 @@ PyArray_GenericUnaryFunction(PyArrayObject *m1, PyObject *op)
309309
Py_INCREF(Py_NotImplemented);
310310
return Py_NotImplemented;
311311
}
312-
return PyObject_CallFunction(op, "(O)", m1);
312+
return PyObject_CallFunctionObjArgs(op, m1, NULL);
313313
}
314314

315315
static PyObject *
@@ -320,7 +320,7 @@ PyArray_GenericInplaceBinaryFunction(PyArrayObject *m1,
320320
Py_INCREF(Py_NotImplemented);
321321
return Py_NotImplemented;
322322
}
323-
return PyObject_CallFunction(op, "OOO", m1, m2, m1);
323+
return PyObject_CallFunctionObjArgs(op, m1, m2, m1, NULL);
324324
}
325325

326326
static PyObject *
@@ -330,7 +330,7 @@ PyArray_GenericInplaceUnaryFunction(PyArrayObject *m1, PyObject *op)
330330
Py_INCREF(Py_NotImplemented);
331331
return Py_NotImplemented;
332332
}
333-
return PyObject_CallFunction(op, "OO", m1, m1);
333+
return PyObject_CallFunctionObjArgs(op, m1, m1, NULL);
334334
}
335335

336336
static PyObject *

0 commit comments

Comments
 (0)