From 59ad110d7a7784d53d0b502eebce0346597a6bef Mon Sep 17 00:00:00 2001 From: Jeroen Demeyer Date: Thu, 11 Jul 2019 10:59:05 +0200 Subject: bpo-37547: add _PyObject_CallMethodOneArg (GH-14685) --- Python/sysmodule.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index dc198a5d1e0..103a1115241 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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; } -- cgit v1.2.3