parametrization: move comment, fix exception error msg (#5142)

This commit is contained in:
Saugat Pachhai
2020-12-21 13:04:55 +05:45
committed by GitHub
parent 5db7a4cab6
commit 4b30b8bea6
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -136,14 +136,14 @@ class DataResolver:
except ContextError as exc:
format_and_raise(exc, "'vars'", self.relpath)
# we wrap the definitions into ForeachDefinition and EntryDefinition,
# that helps us to optimize, cache and selectively load each one of
# them as we need, and simplify all of this DSL/parsing logic.
# we use `tracked_vars` to keep a dictionary of used variables
# by the interpolated entries.
self.tracked_vars: Dict[str, Mapping] = {}
stages_data = d.get(STAGES_KWD, {})
# we wrap the definitions into ForeachDefinition and EntryDefinition,
# that helps us to optimize, cache and selectively load each one of
# them as we need, and simplify all of this DSL/parsing logic.
self.definitions: Dict[str, Definition] = {
name: make_definition(self, name, definition)
for name, definition in stages_data.items()
+2 -2
View File
@@ -335,9 +335,9 @@ class Context(CtxDict):
Defaults to False. Note that the default is different from
`resolve`.
"""
key = normalize_key(key)
normalized = normalize_key(key)
try:
node = super().select(key)
node = super().select(normalized)
except ValueError as exc:
raise KeyNotInContext(key) from exc