From: Victor Stinner Date: Thu, 21 Mar 2013 11:21:06 +0000 (+0100) Subject: Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c) X-Git-Tag: v3.3.1rc1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd2d30cf31c61843645a96a377aa0573052c4972;p=thirdparty%2FPython%2Fcpython.git Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c) --- diff --git a/Misc/NEWS b/Misc/NEWS index fe5afdd59003..63784210e5de 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -196,6 +196,9 @@ Core and Builtins Library ------- +- Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt + (CTRL+c). + - Issue #5713: smtplib now handles 421 (closing connection) error codes when sending mail by closing the socket and reporting the 421 error code via the exception appropriate to the command that received the error response. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 35f9fc15dae7..8436f03eeebc 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1181,6 +1181,9 @@ PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args) return NULL; } if (ct == ERR) { + if (PyErr_CheckSignals()) + return NULL; + /* get_wch() returns ERR in nodelay mode */ PyErr_SetString(PyCursesError, "no input"); return NULL;