]> granicus.if.org Git - python/commitdiff
Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 21 Mar 2013 11:21:06 +0000 (12:21 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 21 Mar 2013 11:21:06 +0000 (12:21 +0100)
Misc/NEWS
Modules/_cursesmodule.c

index fe5afdd590038b72daefc9daa73a28764383c9c9..63784210e5de9db948526f34d9078ab5c95cb25f 100644 (file)
--- 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.
index 35f9fc15dae7a4ff8239ff9f0c7d4f0b12edef00..8436f03eeebcd075f9dd78a3ef944df26e11f634 100644 (file)
@@ -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;