diff options
author | Guido van Rossum <guido@python.org> | 1999-02-16 19:40:02 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-02-16 19:40:02 (GMT) |
commit | 6543e88d2ac6a5d4dd7e6e4aae3305eeeaa65d8f (patch) | |
tree | 53e8d4c5e2612a47d736164a0aff1eb75509069c /PC | |
parent | 7d385294a41b465a1bc2b408d09897176ab9a587 (diff) | |
download | cpython-6543e88d2ac6a5d4dd7e6e4aae3305eeeaa65d8f.zip cpython-6543e88d2ac6a5d4dd7e6e4aae3305eeeaa65d8f.tar.gz cpython-6543e88d2ac6a5d4dd7e6e4aae3305eeeaa65d8f.tar.bz2 |
Check for potential error returned by _ungetch().
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; } |