mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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.
This commit is contained in:
parent
20401deae2
commit
61bdb0d319
5 changed files with 14 additions and 10 deletions
|
|
@ -454,7 +454,8 @@ buffered_dealloc_warn(buffered *self, PyObject *source)
|
|||
{
|
||||
if (self->ok && self->raw) {
|
||||
PyObject *r;
|
||||
r = _PyObject_CallMethodId(self->raw, &PyId__dealloc_warn, "O", source);
|
||||
r = _PyObject_CallMethodIdObjArgs(self->raw, &PyId__dealloc_warn,
|
||||
source, NULL);
|
||||
if (r)
|
||||
Py_DECREF(r);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue