summaryrefslogtreecommitdiff
path: root/src/buildstream/_options/optionpool.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-06-25 21:14:40 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-07-01 22:26:47 +0100
commit7585f65696cf8cec4c587c85f8ca068f57e902c6 (patch)
tree964954d3a7762a355cf17d283d825597894cb063 /src/buildstream/_options/optionpool.py
parent328a9816863a8e404311f9ecdac332cd57fb715c (diff)
downloadbuildstream-7585f65696cf8cec4c587c85f8ca068f57e902c6.tar.gz
_yaml: Remove 'node_items' and add 'MappingNode.items()'
One difference is that 'MappingNode.items()' does not strip the provenance from scalars and lists, which ends up not affecting the code much.
Diffstat (limited to 'src/buildstream/_options/optionpool.py')
-rw-r--r--src/buildstream/_options/optionpool.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/_options/optionpool.py b/src/buildstream/_options/optionpool.py
index af0f99b97..96cff898d 100644
--- a/src/buildstream/_options/optionpool.py
+++ b/src/buildstream/_options/optionpool.py
@@ -65,7 +65,7 @@ class OptionPool():
#
def load(self, options):
- for option_name, option_definition in _yaml.node_items(options):
+ for option_name, option_definition in options.items():
# Assert that the option name is a valid symbol
p = _yaml.node_get_provenance(options, option_name)
@@ -272,7 +272,7 @@ class OptionPool():
del node['(?)']
for condition, p in zip(conditions, provenance):
- tuples = list(_yaml.node_items(condition))
+ tuples = list(condition.items())
if len(tuples) > 1:
raise LoadError(LoadErrorReason.INVALID_DATA,
"{}: Conditional statement has more than one key".format(p))
@@ -284,7 +284,7 @@ class OptionPool():
# Prepend the provenance of the error
raise LoadError(e.reason, "{}: {}".format(p, e)) from e
- if not _yaml.is_node(value):
+ if type(value) is not _yaml.MappingNode: # pylint: disable=unidiomatic-typecheck
raise LoadError(LoadErrorReason.ILLEGAL_COMPOSITE,
"{}: Only values of type 'dict' can be composed.".format(p))