summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-09 15:09:30 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-09 15:09:30 (GMT)
commit55ba38a48097e4b21b406cc617df1481727f5c25 (patch)
tree623f4fa4c83ecbdd1c0170399ca72741fbe0fb82 /Modules/_pickle.c
parent61bdb0d31924ec5fd12aa8dbe197002c57dfbf82 (diff)
downloadcpython-55ba38a48097e4b21b406cc617df1481727f5c25.zip
cpython-55ba38a48097e4b21b406cc617df1481727f5c25.tar.gz
cpython-55ba38a48097e4b21b406cc617df1481727f5c25.tar.bz2
Use _PyObject_CallMethodIdObjArgs()
Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() in various modules when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 78c206e..46ea276 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -4571,8 +4571,8 @@ find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
{
_Py_IDENTIFIER(find_class);
- return _PyObject_CallMethodId((PyObject *)self, &PyId_find_class, "OO",
- module_name, global_name);
+ return _PyObject_CallMethodIdObjArgs((PyObject *)self, &PyId_find_class,
+ module_name, global_name, NULL);
}
static Py_ssize_t
@@ -5184,7 +5184,7 @@ instantiate(PyObject *cls, PyObject *args)
else {
_Py_IDENTIFIER(__new__);
- result = _PyObject_CallMethodId(cls, &PyId___new__, "O", cls);
+ result = _PyObject_CallMethodIdObjArgs(cls, &PyId___new__, cls, NULL);
}
return result;
}