summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-06 17:46:19 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-06 17:46:19 (GMT)
commitf17c3de2635df4f5a51c2cb6b99f3e125af19864 (patch)
tree0ce2ba9e92cf1872d318ea136b4640bd7579666f /Modules
parenta5ed5f000aad67d216201d959de4c70b7575309d (diff)
downloadcpython-f17c3de2635df4f5a51c2cb6b99f3e125af19864.zip
cpython-f17c3de2635df4f5a51c2cb6b99f3e125af19864.tar.gz
cpython-f17c3de2635df4f5a51c2cb6b99f3e125af19864.tar.bz2
Use _PyObject_CallNoArg()
Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_asynciomodule.c2
-rw-r--r--Modules/_ctypes/_ctypes.c2
-rw-r--r--Modules/_ctypes/callbacks.c2
-rw-r--r--Modules/_ssl.c2
-rw-r--r--Modules/mathmodule.c6
-rw-r--r--Modules/posixmodule.c4
6 files changed, 9 insertions, 9 deletions
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 @@ task_step_impl(TaskObj *task, PyObject *exc)
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 @@ cast(void *ptr, PyObject *src, PyObject *ctype)
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 @@ static void _CallPythonObject(void *mem,
*/
} 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 @@ _password_callback(char *buf, int size, int rwflag, void *userdata)
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 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
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 @@ static PyObject * math_floor(PyObject *self, PyObject *number) {
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 @@ math_trunc(PyObject *self, PyObject *number)
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 @@ path_converter(PyObject *o, void *p)
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 @@ PyOS_FSPath(PyObject *path)
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;