Skip to content

Commit 07a817c

Browse files
committed
Fix test_keybindings_unused
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent cfa7bc3 commit 07a817c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bpython/config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ def loadini(struct, configfile):
120120
def get_key_no_doublebind(command):
121121
default_commands_to_keys = defaults['keyboard']
122122
requested_key = config.get('keyboard', command)
123-
default_command = default_keys_to_commands[requested_key]
124123

125-
if default_commands_to_keys[default_command] == \
126-
config.get('keyboard', default_command):
127-
setattr(struct, '%s_key' % default_command, '')
124+
try:
125+
default_command = default_keys_to_commands[requested_key]
126+
127+
if default_commands_to_keys[default_command] == \
128+
config.get('keyboard', default_command):
129+
setattr(struct, '%s_key' % default_command, '')
130+
except KeyError:
131+
pass
128132

129133
return requested_key
130134

0 commit comments

Comments
 (0)