summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-19 20:23:09 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-03-19 20:23:09 (GMT)
commitf5d7cc239e61e063e7bab783d55deb8e72210674 (patch)
treec38cd940eb8802126da7f123022f561d2e8e20d8 /Modules
parentfcb6d6a3b3bfba67927ced18dd648ba889e14f4c (diff)
downloadcpython-f5d7cc239e61e063e7bab783d55deb8e72210674.zip
cpython-f5d7cc239e61e063e7bab783d55deb8e72210674.tar.gz
cpython-f5d7cc239e61e063e7bab783d55deb8e72210674.tar.bz2
#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')
-rw-r--r--Modules/_cursesmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 5e1afa9..d1dedb0 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -895,7 +895,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);