Mercurial > hgrepos > Python > libs > ConfigMix
changeset 489:b49164db1273
Remove unused keyword params for ._lookupvar().
It it never called with "default".
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Fri, 17 Dec 2021 16:28:09 +0100 |
| parents | 298510ec8171 |
| children | ea4b7fac02d6 |
| files | configmix/config.py |
| diffstat | 1 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/config.py Fri Dec 17 16:17:17 2021 +0100 +++ b/configmix/config.py Fri Dec 17 16:28:09 2021 +0100 @@ -571,13 +571,12 @@ else: return (name, []) - def _lookupvar(self, *path, **kwds): + def _lookupvar(self, *path): """Lookup a variable within a hierarchy. - If no default is given an unexisting `path` raises a `KeyError` - else `default` is returned. + :raise KeyError: An unexisting `path` raises a `KeyError` + """ - default = kwds.pop("default", _MARKER) if not path: return self try: @@ -589,12 +588,6 @@ raise KeyError( "Configuration variable %r not found" "(missing intermediate keys?)" % (path,)) - except KeyError: - if default is _MARKER: - raise KeyError( - "Configuration variable %r not found" % (path,)) - else: - return default return v def _lookupref(self, key, default=_MARKER):
