[Patches] [ python-Patches-633635 ] Too much chtype in _cursesmodule.c

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Nov 2002 21:07:14 -0800


Patches item #633635, was opened at 2002-11-05 00:07
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=633635&group_id=5470

Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David M. Cooke (dmcooke)
Assigned to: Nobody/Anonymous (nobody)
Summary: Too much chtype in _cursesmodule.c

Initial Comment:
The C prototype for getch is 'int getch(void)', not
'chtype getch(void)', as assumed by _cursesmodule.c
(the same for ungetch and keyname). [I've checked this
under Linux, SunOS, and Tru64]

keyname() seems to segfault if passed -1, so I've
tested for that.

In addition, according to the docs, the .getch() and
.getkey() methods of a window object should throw an
exception when there isn't any input in nodelay mode
(the C functions return ERR (== -1) in this case). I've
fixed getkey, but not getch, in this patch: since getch
returns an int anyways, it seems better to return -1 on
no input.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=633635&group_id=5470