]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101819: Clean up _io windows console io after gh-104197 (#104354)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Wed, 10 May 2023 10:59:31 +0000 (12:59 +0200)
committerGitHub <noreply@github.com>
Wed, 10 May 2023 10:59:31 +0000 (10:59 +0000)
Modules/_io/_iomodule.c
Modules/_io/_iomodule.h
Modules/_io/winconsoleio.c

index 6c5ea287964294c645c0e97e03266bf8c00c0163..ee4eca70e2af8ffcd5d682d9837be10b65bfffb1 100644 (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
index b3873ddf7e0847e988dc202f0ac1a194ca3af324..44d651338e697583c6502fc29512029329462915 100644 (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
 };
index fdb57cff7c04d6a558b72b9b497beab964aa8103..58d9f2963aa93c81f637be7e880f1e7fbd04a7db 100644 (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