Use dict.get instead of catching exceptions.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2014-08-31 20:30:56 +00:00
parent dc4f8e4909
commit f6c5e4bbb7
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -182,11 +182,8 @@ class RecordEditBox(urwid.Edit, Tabbable):
return bool(self.get_edit_text())
def keypress(self, size, key):
try:
if len(key) > 1 and key != "enter":
key = DatabaseData().keys[key]
except:
pass
if len(key) > 1 and key != "enter":
key = DatabaseData().keys.get(key, key)
if key in ("next-field", "previous-field"):
return self._handle_tab(key)
else: