From 2dcb289ed08980c8f97d538060b4ad8d5e82b56a Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 10 May 2023 12:59:31 +0200 Subject: [PATCH] gh-101819: Clean up _io windows console io after gh-104197 (#104354) --- Modules/_io/_iomodule.c | 2 +- Modules/_io/_iomodule.h | 2 +- Modules/_io/winconsoleio.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 6c5ea287964294..ee4eca70e2af8f 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -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 diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h index b3873ddf7e0847..44d651338e6975 100644 --- a/Modules/_io/_iomodule.h +++ b/Modules/_io/_iomodule.h @@ -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 }; diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index fdb57cff7c04d6..58d9f2963aa93c 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -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