From ef1d710c3691e6cc21a563dc7dc6d63fd0d8fa98 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 31 Dec 2016 23:44:46 +0200 Subject: Simplify word to hext lookup --- pgpwordlist/funcs.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pgpwordlist') diff --git a/pgpwordlist/funcs.py b/pgpwordlist/funcs.py index 37a17be..c3648be 100644 --- a/pgpwordlist/funcs.py +++ b/pgpwordlist/funcs.py @@ -33,10 +33,7 @@ _w2hex = _make_reverse_lookup(_words) def get_word(hexstr, offset): - hexstr = hexstr.lower() - t = _words.get(hexstr) - if t is None: - raise KeyError(hexstr) + t = _words[hexstr.lower()] return t[offset % 2] -- cgit v1.2.1