diff options
Diffstat (limited to 'PC')
-rwxr-xr-x | PC/msvcrtmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index fd46c0f..21be21a 100755 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -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; } |