Skip to content
Merged
Prev Previous commit
Next Next commit
Refactor: hide delegate
Add method wraper for _PyIOBase_check_readable
  • Loading branch information
erlend-aasland committed May 9, 2023
commit 703440a7e1717d518ac5b848e6fe72dc002d8bf1
8 changes: 7 additions & 1 deletion Modules/_io/iobase.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ iobase_check_seekable(PyObject *self, PyObject *args)
return _PyIOBase_check_seekable(self, args);
}

static PyObject *
iobase_check_readable(PyObject *self, PyObject *args)
{
return _PyIOBase_check_readable(self, args);
}

/* XXX: IOBase thinks it has to maintain its own internal state in
`__IOBase_closed` and call flush() by itself, but it is redundant with
whatever behaviour a non-trivial derived class will implement. */
Expand Down Expand Up @@ -809,7 +815,7 @@ static PyMethodDef iobase_methods[] = {

{"_checkClosed", _PyIOBase_check_closed, METH_NOARGS},
{"_checkSeekable", iobase_check_seekable, METH_NOARGS},
{"_checkReadable", _PyIOBase_check_readable, METH_NOARGS},
{"_checkReadable", iobase_check_readable, METH_NOARGS},
{"_checkWritable", _PyIOBase_check_writable, METH_NOARGS},

_IO__IOBASE_FILENO_METHODDEF
Expand Down