Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0a0d54

Browse files
Windows fix (first of many)
1 parent fe8c256 commit d0a0d54

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Modules/_io/winconsoleio.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ typedef struct {
154154
wchar_t wbuf;
155155
} winconsoleio;
156156

157-
PyTypeObject PyWindowsConsoleIO_Type;
158-
159157
int
160158
_PyWindowsConsoleIO_closed(PyObject *self)
161159
{
@@ -265,7 +263,8 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
265263
int fd_is_own = 0;
266264
HANDLE handle = NULL;
267265

268-
assert(PyObject_TypeCheck(self, (PyTypeObject *)&PyWindowsConsoleIO_Type));
266+
_PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
267+
assert(PyObject_TypeCheck(self, state->PyWindowsConsoleIO_Type));
269268
if (self->fd >= 0) {
270269
if (self->closefd) {
271270
/* Have to close the existing file first. */

0 commit comments

Comments
 (0)