summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-16 19:40:02 +0000
committerGuido van Rossum <guido@python.org>1999-02-16 19:40:02 +0000
commit79de34344ca8b20d61bdfcfc498391b6ea3542da (patch)
treea58cdae2685a10c2cf684b10ed6d71f71864134b /PC
parent0ba05cc07643ee00c1599b0aa370d8412d5d0719 (diff)
downloadcpython-79de34344ca8b20d61bdfcfc498391b6ea3542da.tar.gz
Check for potential error returned by _ungetch().
Diffstat (limited to 'PC')
-rwxr-xr-xPC/msvcrtmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index fd46c0f3c2..21be21a5c9 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;
}