diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-05-12 07:30:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 07:30:26 (GMT) |
commit | 15795b57d92ee6315b5c8263290944b16834b5f2 (patch) | |
tree | 63a3584fbe5fda12b64d28fa595248c8a980a145 /Modules/_io/iobase.c | |
parent | 718b13277217e90232da5edf7ab3267e59189698 (diff) | |
download | cpython-15795b57d92ee6315b5c8263290944b16834b5f2.zip cpython-15795b57d92ee6315b5c8263290944b16834b5f2.tar.gz cpython-15795b57d92ee6315b5c8263290944b16834b5f2.tar.bz2 |
gh-101819: Prepare _io._IOBase for module state (#104386)
- Add PyIOBase_Type to _io module state
- Pass defining class to _io._IOBase.fileno
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index a74e46c..26f2a31 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -511,15 +511,17 @@ iobase_exit(PyObject *self, PyObject *args) /*[clinic input] _io._IOBase.fileno + cls: defining_class + / -Returns underlying file descriptor if one exists. +Return underlying file descriptor if one exists. -OSError is raised if the IO object does not use a file descriptor. +Raise OSError if the IO object does not use a file descriptor. [clinic start generated code]*/ static PyObject * -_io__IOBase_fileno_impl(PyObject *self) -/*[clinic end generated code: output=7cc0973f0f5f3b73 input=4e37028947dc1cc8]*/ +_io__IOBase_fileno_impl(PyObject *self, PyTypeObject *cls) +/*[clinic end generated code: output=7caaa32a6f4ada3d input=1927c8bea5c85099]*/ { _PyIO_State *state = IO_STATE(); return iobase_unsupported(state, "fileno"); |