summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-23 16:27:40 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-25 15:43:52 +0100
commitc5c0654d194a165196cb5b31c6c3b1e07620e98a (patch)
treec80bf6413423e3cddbdf1c13d27f965618a01482
parent32323695e54d8e25942a02354a5f47633d244fb6 (diff)
downloadbuildstream-c5c0654d194a165196cb5b31c6c3b1e07620e98a.tar.gz
element.py: Simplify some conditions with `in (foo, bar)`
Where we have conditions of the form `var == foo or var == bar` it can be simplified to `var in (foo, bar)` which pylint prefers. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r--buildstream/element.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index de1988d2a..baf0be3f5 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -432,7 +432,7 @@ class Element(Plugin):
visited=visited, recursed=True)
# Yeild self only at the end, after anything needed has been traversed
- if should_yield and (recurse or recursed) and (scope == Scope.ALL or scope == Scope.RUN):
+ if should_yield and (recurse or recursed) and (scope in (Scope.ALL, Scope.RUN)):
yield self
def search(self, scope, name):
@@ -2521,7 +2521,7 @@ class Element(Plugin):
strong_key = meta['strong']
weak_key = meta['weak']
- assert key == strong_key or key == weak_key
+ assert key in (strong_key, weak_key)
self.__metadata_keys[strong_key] = meta
self.__metadata_keys[weak_key] = meta