diff --git a/omegaconf/base.py b/omegaconf/base.py index 9dcb7a934..8dc541a1b 100644 --- a/omegaconf/base.py +++ b/omegaconf/base.py @@ -292,9 +292,11 @@ def _select_impl( ) if ret is not None and not isinstance(ret, Container): + parent_key = ".".join(split[0 : i + 1]) + child_key = split[i + 1] raise ConfigKeyError( - f"Error trying to access {key}: node `{'.'.join(split[0:i + 1])}` " - f"is not a container and thus cannot contain `{split[i + 1]}``" + f"Error trying to access {key}: node `{parent_key}` " + f"is not a container and thus cannot contain `{child_key}`" ) root = ret