[Python-checkins] cpython (3.3): Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt

victor.stinner python-checkins at python.org
Thu Mar 21 12:21:54 CET 2013


http://hg.python.org/cpython/rev/d98a515489db
changeset:   82867:d98a515489db
branch:      3.3
parent:      82865:d068fcbe5009
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Mar 21 12:21:06 2013 +0100
summary:
  Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c)

files:
  Misc/NEWS               |  3 +++
  Modules/_cursesmodule.c |  3 +++
  2 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -196,6 +196,9 @@
 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
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -1181,6 +1181,9 @@
         return NULL;
     }
     if (ct == ERR) {
+        if (PyErr_CheckSignals())
+            return NULL;
+
         /* get_wch() returns ERR in nodelay mode */
         PyErr_SetString(PyCursesError, "no input");
         return NULL;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list