diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-03-19 16:26:53 -0400 |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-03-19 16:26:53 -0400 |
commit | a39c47aab0ec3032e25e8b0783616d50905ea9e2 (patch) | |
tree | 72b04d428ff7d907f447144306e0ac6336a8b496 /Modules/_cursesmodule.c | |
parent | 620e36419aafbb6d5e603bfec7fc9493c3a11b5e (diff) | |
download | cpython-git-a39c47aab0ec3032e25e8b0783616d50905ea9e2.tar.gz |
#8862: Fix curses cleanup with getchar is interrupted by a signal.
I have no idea how one would write a test for this.
Patch by July Tikhonov.
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 5f26c7fa81..b914e5f681 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -885,7 +885,9 @@ PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args) } if (rtn == ERR) { /* getch() returns ERR in nodelay mode */ - PyErr_SetString(PyCursesError, "no input"); + PyErr_CheckSignals(); + if (!PyErr_Occurred()) + PyErr_SetString(PyCursesError, "no input"); return NULL; } else if (rtn<=255) { return Py_BuildValue("c", rtn); |