8000 gh-101819: Adapt _io.PyWindowsConsoleIO_Type to heap type by erlend-aasland · Pull Request #104197 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101819: Adapt _io.PyWindowsConsoleIO_Type to heap type #104197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 7, 2023
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
8000
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.
0