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
Pull in main
  • Loading branch information
erlend-aasland committed May 6, 2023
commit 5390aed09dd378fa1ebd88bf052987682882b656
28 changes: 16 additions & 12 deletions Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,24 +758,28 @@ PyInit__io(void)
state->PyTextIOBase_Type = (PyTypeObject *)Py_NewRef(&PyTextIOBase_Type);

// PyBufferedIOBase_Type(PyIOBase_Type) subclasses
PyTypeObject *base = &PyBufferedIOBase_Type;
ADD_TYPE(m, state->PyBytesIO_Type, &bytesio_spec, base);
ADD_TYPE(m, state->PyBufferedWriter_Type, &bufferedwriter_spec, base);
ADD_TYPE(m, state->PyBufferedReader_Type, &bufferedreader_spec, base);
ADD_TYPE(m, state->PyBufferedRWPair_Type, &bufferedrwpair_spec, base);
ADD_TYPE(m, state->PyBufferedRandom_Type, &bufferedrandom_spec, base);
ADD_TYPE(m, state->PyBytesIO_Type, &bytesio_spec, state->PyBufferedIOBase_Type);
ADD_TYPE(m, state->PyBufferedWriter_Type, &bufferedwriter_spec,
state->PyBufferedIOBase_Type);
ADD_TYPE(m, state->PyBufferedReader_Type, &bufferedreader_spec,
state->PyBufferedIOBase_Type);
ADD_TYPE(m, state->PyBufferedRWPair_Type, &bufferedrwpair_spec,
state->PyBufferedIOBase_Type);
ADD_TYPE(m, state->PyBufferedRandom_Type, &bufferedrandom_spec,
state->PyBufferedIOBase_Type);

// PyRawIOBase_Type(PyIOBase_Type) subclasses
base = &PyRawIOBase_Type;
ADD_TYPE(m, state->PyFileIO_Type, &fileio_spec, base);
state->PyBytesIOBuffer_Type = (PyTypeObject *)Py_NewRef(&_PyBytesIOBuffer_Type);
ADD_TYPE(m, state->PyFileIO_Type, &fileio_spec, state->PyRawIOBase_Type);
#ifdef MS_WINDOWS
ADD_TYPE(m, state->PyWindowsConsoleIO_Type, &winconsoleio_spec, base);
ADD_TYPE(m, state->PyWindowsConsoleIO_Type, &winconsoleio_spec,
state->PyRawIOBase_Type);
#endif

// PyTextIOBase_Type(PyIOBase_Type) subclasses
base = &PyTextIOBase_Type;
ADD_TYPE(m, state->PyStringIO_Type, &stringio_spec, base);
ADD_TYPE(m, state->PyTextIOWrapper_Type, &textiowrapper_spec, base);
ADD_TYPE(m, state->PyStringIO_Type, &stringio_spec, state->PyTextIOBase_Type);
ADD_TYPE(m, state->PyTextIOWrapper_Type, &textiowrapper_spec,
state->PyTextIOBase_Type);

state->initialized = 1;

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.