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

static PyObject *
iobase_check_writable(PyObject *self, PyObject *args)
{
return _PyIOBase_check_writable(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 @@ -816,7 +822,7 @@ static PyMethodDef iobase_methods[] = {
{"_checkClosed", _PyIOBase_check_closed, METH_NOARGS},
{"_checkSeekable", iobase_check_seekable, METH_NOARGS},
{"_checkReadable", iobase_check_readable, METH_NOARGS},
{"_checkWritable", _PyIOBase_check_writable, METH_NOARGS},
{"_checkWritable", iobase_check_writable, METH_NOARGS},

_IO__IOBASE_FILENO_METHODDEF
_IO__IOBASE_ISATTY_METHODDEF
Expand Down