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

Skip to content

Commit bd2d30c

Browse files
committed
Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c)
1 parent 6bd5202 commit bd2d30c

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
@@ -196,6 +196,9 @@ Core and Builtins
196196
Library
197197
-------
198198

199+
- Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt
200+
(CTRL+c).
201+
199202
- Issue #5713: smtplib now handles 421 (closing connection) error codes when
200203
sending mail by closing the socket and reporting the 421 error code via the
201204
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)