diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-23 15:48:34 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-25 15:43:52 +0100 |
commit | 796bd8c9957df406116e4d08ed8129eba810d23e (patch) | |
tree | f6f492407667022d6e56f0db7c98870245c3b298 | |
parent | 9359c0678013e859ad863bf30e1405eeb9f35c65 (diff) | |
download | buildstream-796bd8c9957df406116e4d08ed8129eba810d23e.tar.gz |
_yaml.py: use `in (a,b)` to simply boolean checks
Where we use a construct `val == foo or val == bar` we can instead use
`val in (foo, bar)` which pylint prefers.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | buildstream/_yaml.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py index 30fc77291..5fc4fec28 100644 --- a/buildstream/_yaml.py +++ b/buildstream/_yaml.py @@ -395,9 +395,9 @@ def node_get(node, expected_type, key, indices=None, default_value=_get_sentinel try: if (expected_type == bool and isinstance(value, str)): # Dont coerce booleans to string, this makes "False" strings evaluate to True - if value == 'true' or value == 'True': + if value in ('True', 'true'): value = True - elif value == 'false' or value == 'False': + elif value in ('False', 'false'): value = False else: raise ValueError() |