gh-101819: Clean up _io windows console io after gh-104197 (#104354)

This commit is contained in:
Erlend E. Aasland 2023-05-10 12:59:31 +02:00 committed by GitHub
parent 68a8ca6dc1
commit 2dcb289ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -772,7 +772,7 @@ PyInit__io(void)
// PyRawIOBase_Type(PyIOBase_Type) subclasses
ADD_TYPE(m, state->PyFileIO_Type, &fileio_spec, state->PyRawIOBase_Type);
#ifdef MS_WINDOWS
#ifdef HAVE_WINDOWS_CONSOLE_IO
ADD_TYPE(m, state->PyWindowsConsoleIO_Type, &winconsoleio_spec,
state->PyRawIOBase_Type);
#endif

View File

@ -162,7 +162,7 @@ struct _io_state {
PyTypeObject *PyStringIO_Type;
PyTypeObject *PyTextIOBase_Type;
PyTypeObject *PyTextIOWrapper_Type;
#ifdef MS_WINDOWS
#ifdef HAVE_WINDOWS_CONSOLE_IO
PyTypeObject *PyWindowsConsoleIO_Type;
#endif
};

View File

@ -263,7 +263,7 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
int fd_is_own = 0;
HANDLE handle = NULL;
#ifdef Py_DEBUG
#ifdef NDEBUG
_PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
assert(PyObject_TypeCheck(self, state->PyWindowsConsoleIO_Type));
#endif