summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-09 16:09:30 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-12-09 16:09:30 +0100
commite29cd26d1dfebb2d8ba06fdad88223dec0762cba (patch)
treea2529ca20eb1b3b4804f20e70319572320569b21 /Python/marshal.c
parent09b2d50c0d8d51d884e87076f54671845be322d5 (diff)
downloadcpython-e29cd26d1dfebb2d8ba06fdad88223dec0762cba.tar.gz
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 'Python/marshal.c')
-rw-r--r--Python/marshal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 0889e41050..d71d3c2b9d 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1649,7 +1649,7 @@ marshal_dump(PyObject *self, PyObject *args)
s = PyMarshal_WriteObjectToString(x, version);
if (s == NULL)
return NULL;
- res = _PyObject_CallMethodId(f, &PyId_write, "O", s);
+ res = _PyObject_CallMethodIdObjArgs(f, &PyId_write, s, NULL);
Py_DECREF(s);
return res;
}