Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modules/_io/winconsoleio.c
  • Loading branch information
iritkatriel committed Feb 24, 2023
commit 15e3964fb5e7a0d1ba651e880e7d4dfc1e3f3267
15 changes: 9 additions & 6 deletions Modules/_io/winconsoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,24 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self)
/*[clinic end generated code: output=27ef95b66c29057b input=68c4e5754f8136c2]*/
{
PyObject *res;
PyObject *exc, *val, *tb;
PyObject *exc;
int rc;
res = PyObject_CallMethodOneArg((PyObject*)&PyRawIOBase_Type,
&_Py_ID(close), (PyObject*)self);
if (!self->closefd) {
self->fd = -1;
return res;
}
if (res == NULL)
PyErr_Fetch(&exc, &val, &tb);
if (res == NULL) {
exc = PyErr_GetRaisedException();
}
rc = internal_close(self);
if (res == NULL)
_PyErr_ChainExceptions(exc, val, tb);
if (rc < 0)
if (res == NULL) {
_PyErr_ChainExceptions1(exc);
}
if (rc < 0) {
Py_CLEAR(res);
}
return res;
}

Expand Down