From 09b2d50c0d8d51d884e87076f54671845be322d5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Dec 2016 15:39:28 +0100 Subject: Use _PyObject_CallMethodIdObjArgs() in _io Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() 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. --- Modules/_io/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/_io/fileio.c') diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 54cfb7fa7d..69e35180d7 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -150,8 +150,8 @@ _io_FileIO_close_impl(fileio *self) PyObject *exc, *val, *tb; int rc; _Py_IDENTIFIER(close); - res = _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type, - &PyId_close, "O", self); + res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type, + &PyId_close, self, NULL); if (!self->closefd) { self->fd = -1; return res; -- cgit v1.2.1