From 277dab4069f2afa3f22aef3744726ac369482825 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 9 Sep 2014 22:38:14 +0200 Subject: [PATCH] keyconfparser: Add empty sections. --- qutebrowser/config/keyconfparser.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qutebrowser/config/keyconfparser.py b/qutebrowser/config/keyconfparser.py index 8640ecb93..0def7c17f 100644 --- a/qutebrowser/config/keyconfparser.py +++ b/qutebrowser/config/keyconfparser.py @@ -114,9 +114,12 @@ class KeyConfigParser: """Load the built-in default keybindings.""" for sectname, sect in configdata.KEY_DATA.items(): sectname = self._normalize_sectname(sectname) - for command, keychains in sect.items(): - for e in keychains: - self._add_binding(sectname, e, command) + if not sect: + self.keybindings[sectname] = collections.OrderedDict() + else: + for command, keychains in sect.items(): + for e in keychains: + self._add_binding(sectname, e, command) def _read(self): """Read the config file from disk and parse it."""