diff options
author | Frazer Clews <frazer.clews@codethink.co.uk> | 2020-01-16 17:11:19 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-19 13:30:58 +0000 |
commit | b809a6812aa15a8a9af97bc382cc4b19571e6bfc (patch) | |
tree | 2558aa5cbbf8807b56968fdd1a2850a65aa897b7 /lib/bb/providers.py | |
parent | 4367692a932ac135c5aa4f9f2a4e4f0150f76697 (diff) | |
download | bitbake-b809a6812aa15a8a9af97bc382cc4b19571e6bfc.tar.gz |
lib: amend code to use proper singleton comparisons where possible
amend the code to handle singleton comparisons properly so it only checks
if they only refer to the same object or not, and not bother
comparing the values.
Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/providers.py')
-rw-r--r-- | lib/bb/providers.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bb/providers.py b/lib/bb/providers.py index f80963cb4..81459c36d 100644 --- a/lib/bb/providers.py +++ b/lib/bb/providers.py @@ -92,11 +92,11 @@ def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r): Check if the version pe,pv,pr is the preferred one. If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%' """ - if (pr == preferred_r or preferred_r == None): - if (pe == preferred_e or preferred_e == None): + if pr == preferred_r or preferred_r is None: + if pe == preferred_e or preferred_e is None: if preferred_v == pv: return True - if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]): + if preferred_v is not None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]): return True return False |