Check for potential error returned by _ungetch().
This commit is contained in:
parent
7d385294a4
commit
6543e88d2a
|
@ -165,7 +165,8 @@ static PyObject *msvcrt_ungetch(PyObject *self, PyObject *args)
|
|||
if (!PyArg_ParseTuple(args, "c:ungetch", &ch))
|
||||
return NULL;
|
||||
|
||||
_ungetch(ch);
|
||||
if (_ungetch(ch) == EOF)
|
||||
return PyErr_SetFromErrno(PyExc_IOError);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue