summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-08 23:36:19 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-08 23:36:19 (GMT)
commit7e42541d08b6cc103b892c1cb70ea68c66751078 (patch)
tree082013fb3c953cb156f6591cbc3bcca6db787ca8 /Python/sysmodule.c
parent4c38154a432885a933b539c2682e66caaf440117 (diff)
downloadcpython-7e42541d08b6cc103b892c1cb70ea68c66751078.zip
cpython-7e42541d08b6cc103b892c1cb70ea68c66751078.tar.gz
cpython-7e42541d08b6cc103b892c1cb70ea68c66751078.tar.bz2
Use _PyObject_CallMethodIdObjArgs()
Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string only use the format 'O' for objects, like "(O)". _PyObject_CallMethodIdObjArgs() avoids the code to parse a format string and avoids the creation of a temporary tuple.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 1537313..9c4d9e6 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -130,7 +130,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
buffer = _PyObject_GetAttrId(outf, &PyId_buffer);
if (buffer) {
- result = _PyObject_CallMethodId(buffer, &PyId_write, "(O)", encoded);
+ result = _PyObject_CallMethodIdObjArgs(buffer, &PyId_write, encoded, NULL);
Py_DECREF(buffer);
Py_DECREF(encoded);
if (result == NULL)