From a275c823f07fb6d737ba7288056abce1599eecec Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Tue, 25 Jun 2019 17:51:36 +0100 Subject: _yaml: Remove 'node_del' and support `del mapping[key]` - Also add a convenience method 'safe_del' catching the exception when we don't care if the value was there or not. --- src/buildstream/_project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildstream/_project.py') diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py index b53787b17..e1e873858 100644 --- a/src/buildstream/_project.py +++ b/src/buildstream/_project.py @@ -753,8 +753,8 @@ class Project(): # assertion after. output.element_overrides = config.get_mapping('elements', default={}) output.source_overrides = config.get_mapping('sources', default={}) - _yaml.node_del(config, 'elements', safe=True) - _yaml.node_del(config, 'sources', safe=True) + config.safe_del('elements') + config.safe_del('sources') _yaml.node_final_assertions(config) self._load_plugin_factories(config, output) @@ -943,7 +943,7 @@ class Project(): _yaml.node_set(origin_node, 'plugins', [k for k in _yaml.node_keys(plugins)]) for group in expected_groups: if group in origin_node: - _yaml.node_del(origin_node, group) + del origin_node[group] if origin_node.get_str('origin') == 'local': path = self.get_path_from_node(origin, 'path', -- cgit v1.2.1