diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-03-24 22:05:23 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-03-24 22:10:12 +0200 |
commit | 2446d1b99cc7b0c4e8ae56fdbfa850fc56069eda (patch) | |
tree | 2848a8bf3955fb82d03ab30a0c01d9ebf516ab50 | |
parent | fdf2bb0fecc52535539cbb4eae684c02249b6c81 (diff) | |
download | cliapp-2446d1b99cc7b0c4e8ae56fdbfa850fc56069eda.tar.gz |
Fix to handle empty "config:" in a YAML config file
-rw-r--r-- | cliapp/settings.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |