mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
4c38154a43
commit
7e42541d08
3 changed files with 5 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue