diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 3a1b7ee29e..f564e08279 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -5051,6 +5051,20 @@ test_write_unraisable_exc(PyObject *self, PyObject *args) } +static PyObject* +call_no_args(PyObject *self, PyObject *func) +{ + return PyObject_CallNoArgs(func); +} + + +static PyObject* +call_no_args2(PyObject *self, PyObject *func) +{ + return PyObject_CallFunctionObjArgs(func, NULL); +} + + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"raise_memoryerror", raise_memoryerror, METH_NOARGS}, @@ -5294,6 +5308,8 @@ static PyMethodDef TestMethods[] = { {"negative_refcount", negative_refcount, METH_NOARGS}, #endif {"write_unraisable_exc", test_write_unraisable_exc, METH_VARARGS}, + {"call_no_args", call_no_args, METH_O}, + {"call_no_args2", call_no_args2, METH_O}, {NULL, NULL} /* sentinel */ };