mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
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.
This commit is contained in:
parent
61bdb0d319
commit
55ba38a480
6 changed files with 9 additions and 9 deletions
|
@ -1445,7 +1445,7 @@ array_array_tofile(arrayobject *self, PyObject *f)
|
|||
bytes = PyBytes_FromStringAndSize(ptr, size);
|
||||
if (bytes == NULL)
|
||||
return NULL;
|
||||
res = _PyObject_CallMethodId(f, &PyId_write, "O", bytes);
|
||||
res = _PyObject_CallMethodIdObjArgs(f, &PyId_write, bytes, NULL);
|
||||
Py_DECREF(bytes);
|
||||
if (res == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue