Skip to content

Commit

Permalink
gh-101819: Clean up _io windows console io after gh-104197 (#104354)
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland authored May 10, 2023
1 parent 68a8ca6 commit 2dcb289
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Modules/_io/_iomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Modules/_io/_iomodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
2 changes: 1 addition & 1 deletion Modules/_io/winconsoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dcb289

Please sign in to comment.