From 42d3d8406a15cd5f6f4a7d00e298dba019a50ed6 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Tue, 25 Jun 2019 20:27:15 +0100 Subject: _yaml: Introduce 'MappingNode.values()' This is to mimic the 'dict.values()' interface. - Adapt parts of the code calling 'node_items' but ignoring the first value to use this instead --- src/buildstream/_includes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/buildstream/_includes.py') diff --git a/src/buildstream/_includes.py b/src/buildstream/_includes.py index f63e56213..ea2bf484e 100644 --- a/src/buildstream/_includes.py +++ b/src/buildstream/_includes.py @@ -83,7 +83,7 @@ class Includes: _yaml.composite_and_move(node, include_node) - for _, value in _yaml.node_items(node): + for value in node.values(): self._process_value(value, included=included, current_loader=current_loader, @@ -129,12 +129,14 @@ class Includes: included=set(), current_loader=None, only_local=False): - if _yaml.is_node(value): + value_type = type(value) + + if value_type is _yaml.MappingNode: self.process(value, included=included, current_loader=current_loader, only_local=only_local) - elif isinstance(value, list): + elif value_type is _yaml.SequenceNode: for v in value: self._process_value(v, included=included, -- cgit v1.2.1