Commit 0db87654 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

config: Avoid altering the values dict by doing a get()

When using default and accessing levels that don't exist, they would be
filled by empty dicts.
It is also faster as we return early.
parent d8b93e5e
......@@ -87,8 +87,7 @@ class YamlConfig(IConfig):
v = v[a]
except KeyError:
if 'default' in kwargs:
v[a] = {}
v = v[a]
return kwargs['default']
else:
raise ConfigError()
except TypeError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment