diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-24 10:25:28 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-25 15:43:52 +0100 |
commit | eb805c6c8f4bc20eda4db09534b9986f6702597d (patch) | |
tree | d12f828e16a8c006cdec95e96565160c7917073b /buildstream | |
parent | 31a7bce57793e0d72412a4a9e9e7f8d34a0c7d05 (diff) | |
download | buildstream-eb805c6c8f4bc20eda4db09534b9986f6702597d.tar.gz |
_options/optionbool.py: Refactor conditions
The pylint tool prefers that conditions of the form "var == foo or var == bar"
be refactored into "var in (foo, bar)".
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/_options/optionbool.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_options/optionbool.py b/buildstream/_options/optionbool.py index ffef55ca1..867de22df 100644 --- a/buildstream/_options/optionbool.py +++ b/buildstream/_options/optionbool.py @@ -43,9 +43,9 @@ class OptionBool(Option): self.value = _yaml.node_get(node, bool, self.name) def set_value(self, value): - if value == 'True' or value == 'true': + if value in ('True', 'true'): self.value = True - elif value == 'False' or value == 'false': + elif value in ('False', 'false'): self.value = False else: raise LoadError(LoadErrorReason.INVALID_DATA, |