diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-06-25 17:51:36 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:02 +0000 |
commit | a275c823f07fb6d737ba7288056abce1599eecec (patch) | |
tree | ed159afda3e837535c08d916577f615049d479f0 /src/buildstream/_loader/loader.py | |
parent | bb3c8045cd89a7c4d1d7cd2e03736496dd449fb9 (diff) | |
download | buildstream-a275c823f07fb6d737ba7288056abce1599eecec.tar.gz |
_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.
Diffstat (limited to 'src/buildstream/_loader/loader.py')
-rw-r--r-- | src/buildstream/_loader/loader.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py index 33a7762d1..750df40c9 100644 --- a/src/buildstream/_loader/loader.py +++ b/src/buildstream/_loader/loader.py @@ -471,12 +471,12 @@ class Loader(): for index, source in enumerate(sources): kind = source.get_str(Symbol.KIND) - _yaml.node_del(source, Symbol.KIND) + del source[Symbol.KIND] # Directory is optional directory = source.get_str(Symbol.DIRECTORY, default=None) if directory: - _yaml.node_del(source, Symbol.DIRECTORY) + del source[Symbol.DIRECTORY] meta_source = MetaSource(element.name, index, element_kind, kind, source, directory) meta_sources.append(meta_source) |