summaryrefslogtreecommitdiffstats
path: root/Modules/_io/iobase.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r--Modules/_io/iobase.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 82cc776..d51fc94 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -235,7 +235,7 @@ _io__IOBase_close_impl(PyObject *self)
Py_RETURN_NONE;
}
- res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL);
+ res = _PyObject_CallMethodNoArgs(self, _PyIO_str_flush);
PyErr_Fetch(&exc, &val, &tb);
rc = _PyObject_SetAttrId(self, &PyId___IOBase_closed, Py_True);
@@ -281,8 +281,7 @@ iobase_finalize(PyObject *self)
finalization process. */
if (_PyObject_SetAttrId(self, &PyId__finalizing, Py_True))
PyErr_Clear();
- res = PyObject_CallMethodObjArgs((PyObject *) self, _PyIO_str_close,
- NULL);
+ res = _PyObject_CallMethodNoArgs((PyObject *)self, _PyIO_str_close);
/* Silencing I/O errors is bad, but printing spurious tracebacks is
equally as bad, and potentially more frequent (because of
shutdown issues). */
@@ -383,7 +382,7 @@ _io__IOBase_seekable_impl(PyObject *self)
PyObject *
_PyIOBase_check_seekable(PyObject *self, PyObject *args)
{
- PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_seekable, NULL);
+ PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_seekable);
if (res == NULL)
return NULL;
if (res != Py_True) {
@@ -416,7 +415,7 @@ _io__IOBase_readable_impl(PyObject *self)
PyObject *
_PyIOBase_check_readable(PyObject *self, PyObject *args)
{
- PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_readable, NULL);
+ PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_readable);
if (res == NULL)
return NULL;
if (res != Py_True) {
@@ -449,7 +448,7 @@ _io__IOBase_writable_impl(PyObject *self)
PyObject *
_PyIOBase_check_writable(PyObject *self, PyObject *args)
{
- PyObject *res = PyObject_CallMethodObjArgs(self, _PyIO_str_writable, NULL);
+ PyObject *res = _PyObject_CallMethodNoArgs(self, _PyIO_str_writable);
if (res == NULL)
return NULL;
if (res != Py_True) {
@@ -478,7 +477,7 @@ iobase_enter(PyObject *self, PyObject *args)
static PyObject *
iobase_exit(PyObject *self, PyObject *args)
{
- return PyObject_CallMethodObjArgs(self, _PyIO_str_close, NULL);
+ return _PyObject_CallMethodNoArgs(self, _PyIO_str_close);
}
/* Lower-level APIs */
@@ -656,7 +655,7 @@ iobase_iter(PyObject *self)
static PyObject *
iobase_iternext(PyObject *self)
{
- PyObject *line = PyObject_CallMethodObjArgs(self, _PyIO_str_readline, NULL);
+ PyObject *line = _PyObject_CallMethodNoArgs(self, _PyIO_str_readline);
if (line == NULL)
return NULL;
@@ -921,7 +920,7 @@ _io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n)
if (n < 0) {
_Py_IDENTIFIER(readall);
- return _PyObject_CallMethodId(self, &PyId_readall, NULL);
+ return _PyObject_CallMethodIdNoArgs(self, &PyId_readall);
}
/* TODO: allocate a bytes object directly instead and manually construct