From 2446d1b99cc7b0c4e8ae56fdbfa850fc56069eda Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 24 Mar 2017 22:05:23 +0200 Subject: Fix to handle empty "config:" in a YAML config file --- cliapp/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cliapp/settings.py b/cliapp/settings.py index f92fb78..7bc0ec4 100644 --- a/cliapp/settings.py +++ b/cliapp/settings.py @@ -843,7 +843,7 @@ class Settings(object): def _read_yaml(self, pathname, f): obj = yaml.safe_load(f) self._check_yaml(pathname, obj) - config = obj.get('config', {}) + config = obj.get('config') or {} for name, value in config.items(): if name not in self._settingses: raise UnknownConfigVariable(pathname, name) -- cgit v1.2.1