Visitar URL original
gh-101819: Refactor _io in preparation for module isolation by erlend-aasland · Pull Request #104334 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor: hide delegate
Add method wrapper for _PyIOBase_check_seekable.
  • Loading branch information
erlend-aasland committed May 9, 2023
commit 8adc0cd0e7eb3b295f7455eeedb6fc31b2c9d391
8 changes: 7 additions & 1 deletion Modules/_io/iobase.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ _PyIOBase_check_closed(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}

static PyObject *
iobase_check_seekable(PyObject *self, PyObject *args)
{
return _PyIOBase_check_seekable(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 @@ -802,7 +808,7 @@ static PyMethodDef iobase_methods[] = {
_IO__IOBASE_WRITABLE_METHODDEF

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

Expand Down