summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/multibytecodec.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/cjkcodecs/multibytecodec.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/cjkcodecs/multibytecodec.c')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index d1da189..15c8969 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -1611,7 +1611,7 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
if (str == NULL)
return -1;
- wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", str);
+ wr = _PyObject_CallMethodIdObjArgs(self->stream, &PyId_write, str, NULL);
Py_DECREF(str);
if (wr == NULL)
return -1;
@@ -1702,7 +1702,7 @@ _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *se
if (PyBytes_Size(pwrt) > 0) {
PyObject *wr;
- wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", pwrt);
+ wr = _PyObject_CallMethodIdObjArgs(self->stream, &PyId_write, pwrt);
if (wr == NULL) {
Py_DECREF(pwrt);
return NULL;