Mercurial > hgrepos > Python > libs > ConfigMix
changeset 449:5864977bb44f
FIX: KeyError formatting.
For jailed configs: self._path is a tuple and must be wrapped into a tuple
when used for "%"-style error formatting.
| author | Franz Glasner <f.glasner@feldmann-mg.com> |
|---|---|
| date | Tue, 14 Dec 2021 14:28:10 +0100 |
| parents | b95c12781497 |
| children | 12f25ac6a13b |
| files | configmix/config.py |
| diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/configmix/config.py Sat Dec 11 19:56:35 2021 +0100 +++ b/configmix/config.py Tue Dec 14 14:28:10 2021 +0100 @@ -844,8 +844,10 @@ # Early error out if the chroot does not exist but allow # degenerated case if `self._path` is empty. # - if self._path: - new_base.getvarl(*self._path) + if self._path and self._path not in new_base: + raise KeyError( + "base key path %r not available in the new base" + % (self._path, )) def __getattr__(self, name): try:
