summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-04 10:31:34 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-04 10:31:34 (GMT)
commit196a530e00d88a138973bf9182e013937e293f97 (patch)
tree35443abb5aa148b459f68ae43a18cdbb0627ba76 /Modules/_pickle.c
parent9d40554e0da09a44a8547f3f3a2b9dedfeaf7928 (diff)
downloadcpython-196a530e00d88a138973bf9182e013937e293f97.zip
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.gz
cpython-196a530e00d88a138973bf9182e013937e293f97.tar.bz2
bpo-37483: add _PyObject_CallOneArg() function (#14558)
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 3adece0..d6d1250 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -359,7 +359,7 @@ _Pickle_FastCall(PyObject *func, PyObject *obj)
{
PyObject *result;
- result = PyObject_CallFunctionObjArgs(func, obj, NULL);
+ result = _PyObject_CallOneArg(func, obj);
Py_DECREF(obj);
return result;
}
@@ -420,7 +420,7 @@ call_method(PyObject *func, PyObject *self, PyObject *obj)
return PyObject_CallFunctionObjArgs(func, self, obj, NULL);
}
else {
- return PyObject_CallFunctionObjArgs(func, obj, NULL);
+ return _PyObject_CallOneArg(func, obj);
}
}
@@ -2296,7 +2296,7 @@ _Pickler_write_bytes(PicklerObject *self,
return -1;
}
}
- result = PyObject_CallFunctionObjArgs(self->write, payload, NULL);
+ result = _PyObject_CallOneArg(self->write, payload);
Py_XDECREF(mem);
if (result == NULL) {
return -1;
@@ -2504,8 +2504,7 @@ save_picklebuffer(PicklerObject *self, PyObject *obj)
}
int in_band = 1;
if (self->buffer_callback != NULL) {
- PyObject *ret = PyObject_CallFunctionObjArgs(self->buffer_callback,
- obj, NULL);
+ PyObject *ret = _PyObject_CallOneArg(self->buffer_callback, obj);
if (ret == NULL) {
return -1;
}
@@ -4322,8 +4321,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
* regular reduction mechanism.
*/
if (self->reducer_override != NULL) {
- reduce_value = PyObject_CallFunctionObjArgs(self->reducer_override,
- obj, NULL);
+ reduce_value = _PyObject_CallOneArg(self->reducer_override, obj);
if (reduce_value == NULL) {
goto error;
}