diff options
| author | Andrew M. Kuchling <amk@amk.ca> | 2003-09-02 11:44:44 +0000 |
|---|---|---|
| committer | Andrew M. Kuchling <amk@amk.ca> | 2003-09-02 11:44:44 +0000 |
| commit | a4b643e21120153a0676bd4090bd3a1f38ec3456 (patch) | |
| tree | 48170fdb021960918a7db4ced4cdcda570e72a80 /Lib/curses | |
| parent | 408ac83cd3f8c447c1596a013e3103534d112eea (diff) | |
| download | cpython-a4b643e21120153a0676bd4090bd3a1f38ec3456.tar.gz | |
[Patch #759208] Fix has_key emulation to not raise KeyError
Diffstat (limited to 'Lib/curses')
| -rw-r--r-- | Lib/curses/has_key.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/curses/has_key.py b/Lib/curses/has_key.py index 728c614f20..cac0cd11c1 100644 --- a/Lib/curses/has_key.py +++ b/Lib/curses/has_key.py @@ -163,7 +163,9 @@ def has_key(ch): if type(ch) == type( '' ): ch = ord(ch) # Figure out the correct capability name for the keycode. - capability_name = _capability_names[ch] + capability_name = _capability_names.get(ch) + if capability_name is None: + return 0 #Check the current terminal description for that capability; #if present, return true, else return false. |
