bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)

This commit is contained in:
Jeroen Demeyer 2019-07-11 10:59:05 +02:00 committed by Inada Naoki
parent 2a3d4d9c53
commit 59ad110d7a
23 changed files with 104 additions and 93 deletions

View file

@ -581,7 +581,7 @@ sys_displayhook_unencodable(PyThreadState *tstate, PyObject *outf, PyObject *o)
buffer = _PyObject_GetAttrId(outf, &PyId_buffer);
if (buffer) {
result = _PyObject_CallMethodIdObjArgs(buffer, &PyId_write, encoded, NULL);
result = _PyObject_CallMethodIdOneArg(buffer, &PyId_write, encoded);
Py_DECREF(buffer);
Py_DECREF(encoded);
if (result == NULL)
@ -3114,9 +3114,7 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
if (file == NULL)
return -1;
assert(unicode != NULL);
PyObject *margs[2] = {file, unicode};
PyObject *result = _PyObject_VectorcallMethodId(&PyId_write, margs,
2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
PyObject *result = _PyObject_CallMethodIdOneArg(file, &PyId_write, unicode);
if (result == NULL) {
return -1;
}