diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-16 18:31:19 +0100 |
---|---|---|
committer | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-16 18:32:48 +0100 |
commit | f2ece705b7bf36d7d923264af2b1f51b66a9f9a7 (patch) | |
tree | 7df4a79b12013f6094371e86bcf52bb6aa8719e7 /src/buildstream/_options/optionenum.py | |
parent | fbb8eea8334023e30c8719cb52f9b0e226b4eb8b (diff) | |
download | buildstream-bschubert/api-improvements.tar.gz |
node: Add 'get_str_list' on 'MappingNode'bschubert/api-improvements
`mapping.get_sequence(...).as_str_list()` is a very common
pattern seen both in plugins and the core. Adding a helper to reduce
the number of operations will make usage smoother
Diffstat (limited to 'src/buildstream/_options/optionenum.py')
-rw-r--r-- | src/buildstream/_options/optionenum.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/_options/optionenum.py b/src/buildstream/_options/optionenum.py index d1a7a85c9..3d5053639 100644 --- a/src/buildstream/_options/optionenum.py +++ b/src/buildstream/_options/optionenum.py @@ -45,7 +45,7 @@ class OptionEnum(Option): node.validate_keys(valid_symbols) - self.values = node.get_sequence('values', default=[]).as_str_list() + self.values = node.get_str_list('values', default=[]) if not self.values: raise LoadError(LoadErrorReason.INVALID_DATA, "{}: No values specified for {} option '{}'" |