diff options
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r-- | Modules/_io/textio.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 4df55626d4..1d32d5320a 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -899,8 +899,8 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer, PyObject *locale_module = _PyIO_get_locale_module(state); if (locale_module == NULL) goto catch_ImportError; - self->encoding = _PyObject_CallMethodId( - locale_module, &PyId_getpreferredencoding, "O", Py_False); + self->encoding = _PyObject_CallMethodIdObjArgs( + locale_module, &PyId_getpreferredencoding, Py_False, NULL); Py_DECREF(locale_module); if (self->encoding == NULL) { catch_ImportError: @@ -2435,7 +2435,7 @@ _io_TextIOWrapper_tell_impl(textio *self) } finally: - res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state); + res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL); Py_DECREF(saved_state); if (res == NULL) return NULL; @@ -2449,7 +2449,7 @@ fail: if (saved_state) { PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); - res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state); + res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL); _PyErr_ChainExceptions(type, value, traceback); Py_DECREF(saved_state); Py_XDECREF(res); @@ -2644,7 +2644,9 @@ _io_TextIOWrapper_close_impl(textio *self) else { PyObject *exc = NULL, *val, *tb; if (self->finalizing) { - res = _PyObject_CallMethodId(self->buffer, &PyId__dealloc_warn, "O", self); + res = _PyObject_CallMethodIdObjArgs(self->buffer, + &PyId__dealloc_warn, + self, NULL); if (res) Py_DECREF(res); else |