summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-19 20:24:35 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-03-19 20:24:35 (GMT)
commit779dab9447db4a2b139270de4401c2cf8af87363 (patch)
tree45f7eb3b69045714686c73c7183cca55fc23b48b
parent7889944b83cf04cefb45cd658644298218eac5db (diff)
parentf5d7cc239e61e063e7bab783d55deb8e72210674 (diff)
downloadcpython-779dab9447db4a2b139270de4401c2cf8af87363.zip
cpython-779dab9447db4a2b139270de4401c2cf8af87363.tar.gz
cpython-779dab9447db4a2b139270de4401c2cf8af87363.tar.bz2
Merge: #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.
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_cursesmodule.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 7e126c4..8b64f79 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -193,6 +193,8 @@ Core and Builtins
Library
-------
+- Issue #8862: Fixed curses cleanup when getkey is interrputed by a signal.
+
- Issue #17443: impalib.IMAP4_stream was using the default unbuffered IO
in subprocess, but the imap code assumes buffered IO. In Python2 this
worked by accident. IMAP4_stream now explicitly uses buffered IO.
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 4e1449b..35f9fc1 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -1138,7 +1138,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);