# HG changeset patch # User Franz Glasner # Date 1521822321 -3600 # Node ID d9f9a06e0c49fd700cf7254d123d3abd180e0d17 # Parent 2eac386f825aae29c2503686dc1c4531e7ad8e5e Make a better error message for "TypeError" exceptions when looking up variables. Otherwise -- if a key exists but if it's not a dict as expected a TypeError is throws that nobody does understand. diff -r 2eac386f825a -r d9f9a06e0c49 configmix/config.py --- a/configmix/config.py Fri Mar 23 15:54:22 2018 +0100 +++ b/configmix/config.py Fri Mar 23 17:25:21 2018 +0100 @@ -154,6 +154,8 @@ v = self[parts[0]] for p in parts[1:]: v = v[p] + except TypeError: + raise KeyError("Configuration variable %r not found (missing intermediate keys?)" % key) except KeyError: if default is _MARKER: raise KeyError("Configuration variable %r not found" % key)