[Patch #759208] Fix has_key emulation to not raise KeyError
diff --git a/Lib/curses/has_key.py b/Lib/curses/has_key.py
index 728c614..cac0cd1 100644
--- a/Lib/curses/has_key.py
+++ b/Lib/curses/has_key.py
@@ -163,7 +163,9 @@
     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.