Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d06b35c

Browse files
committed
(Merge 3.3) Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c)
2 parents e0a1bf3 + bd2d30c commit d06b35c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ Core and Builtins
292292
Library
293293
-------
294294

295+
- Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt
296+
(CTRL+c).
297+
295298
- Issue #5713: smtplib now handles 421 (closing connection) error codes when
296299
sending mail by closing the socket and reporting the 421 error code via the
297300
exception appropriate to the command that received the error response.

Modules/_cursesmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,9 @@ PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args)
11811181
return NULL;
11821182
}
11831183
if (ct == ERR) {
1184+
if (PyErr_CheckSignals())
1185+
return NULL;
1186+
11841187
/* get_wch() returns ERR in nodelay mode */
11851188
PyErr_SetString(PyCursesError, "no input");
11861189
return NULL;

0 commit comments

Comments
 (0)