Browse Source

#8862: Fix curses cleanup with getchar is interrupted by a signal.

I have no idea how one would write a test for this.

Patch by July Tikhonov.
pull/2332/head
R David Murray 14 years ago
parent
commit
a39c47aab0
  1. 2
      Misc/NEWS
  2. 4
      Modules/_cursesmodule.c

2
Misc/NEWS

@ -214,6 +214,8 @@ Core and Builtins
Library
-------
- Issue #8862: Fixed curses cleanup when getkey is interrputed by a signal.
- Issue #9090: When a socket with a timeout fails with EWOULDBLOCK or EAGAIN,
retry the select() loop instead of bailing out. This is because select()
can incorrectly report a socket as ready for reading (for example, if it

4
Modules/_cursesmodule.c

@ -885,7 +885,9 @@ PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args)
}
if (rtn == ERR) {
/* getch() returns ERR in nodelay mode */
PyErr_SetString(PyCursesError, "no input");
PyErr_CheckSignals();
if (!PyErr_Occurred())
PyErr_SetString(PyCursesError, "no input");
return NULL;
} else if (rtn<=255) {
return Py_BuildValue("c", rtn);

Loading…
Cancel
Save