Use _PyObject_CallNoArg()
Replace:
PyObject_CallFunctionObjArgs(callable, NULL)
with:
_PyObject_CallNoArg(callable)
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 67794c3..d8522b9 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -1948,7 +1948,7 @@
if (!exc) {
/* exc was not a CancelledError */
- exc = PyObject_CallFunctionObjArgs(asyncio_CancelledError, NULL);
+ exc = _PyObject_CallNoArg(asyncio_CancelledError);
if (!exc) {
goto fail;
}
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 5048d9c..47d8f56 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -5258,7 +5258,7 @@
CDataObject *result;
if (0 == cast_check_pointertype(ctype))
return NULL;
- result = (CDataObject *)PyObject_CallFunctionObjArgs(ctype, NULL);
+ result = (CDataObject *)_PyObject_CallNoArg(ctype);
if (result == NULL)
return NULL;
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index b958f30..2c57d6b 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -181,7 +181,7 @@
*/
} else if (dict) {
/* Hm, shouldn't we use PyCData_AtAddress() or something like that instead? */
- CDataObject *obj = (CDataObject *)PyObject_CallFunctionObjArgs(cnv, NULL);
+ CDataObject *obj = (CDataObject *)_PyObject_CallNoArg(cnv);
if (!obj) {
PrintError("create argument %d:\n", i);
Py_DECREF(cnv);
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index b198857..6003476 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -3197,7 +3197,7 @@
PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
if (pw_info->callable) {
- fn_ret = PyObject_CallFunctionObjArgs(pw_info->callable, NULL);
+ fn_ret = _PyObject_CallNoArg(pw_info->callable);
if (!fn_ret) {
/* TODO: It would be nice to move _ctypes_add_traceback() into the
core python API, so we could use it to add a frame here */
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 95ea4f7..e7e34ef 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -951,7 +951,7 @@
return NULL;
return math_1_to_int(number, ceil, 0);
}
- result = PyObject_CallFunctionObjArgs(method, NULL);
+ result = _PyObject_CallNoArg(method);
Py_DECREF(method);
return result;
}
@@ -991,7 +991,7 @@
return NULL;
return math_1_to_int(number, floor, 0);
}
- result = PyObject_CallFunctionObjArgs(method, NULL);
+ result = _PyObject_CallNoArg(method);
Py_DECREF(method);
return result;
}
@@ -1542,7 +1542,7 @@
Py_TYPE(number)->tp_name);
return NULL;
}
- result = PyObject_CallFunctionObjArgs(trunc, NULL);
+ result = _PyObject_CallNoArg(trunc);
Py_DECREF(trunc);
return result;
}
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index bec7699..fee5711 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -902,7 +902,7 @@
goto error_exit;
}
- o = to_cleanup = PyObject_CallFunctionObjArgs(func, NULL);
+ o = to_cleanup = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (NULL == o) {
goto error_exit;
@@ -12046,7 +12046,7 @@
Py_TYPE(path)->tp_name);
}
- path_repr = PyObject_CallFunctionObjArgs(func, NULL);
+ path_repr = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (NULL == path_repr) {
return NULL;