summaryrefslogtreecommitdiffstats
path: root/lib/bb/ui
diff options
context:
space:
mode:
authorFrazer Clews <frazer.clews@codethink.co.uk>2020-01-16 17:11:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-19 13:30:58 +0000
commitb809a6812aa15a8a9af97bc382cc4b19571e6bfc (patch)
tree2558aa5cbbf8807b56968fdd1a2850a65aa897b7 /lib/bb/ui
parent4367692a932ac135c5aa4f9f2a4e4f0150f76697 (diff)
downloadbitbake-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/ui')
-rw-r--r--lib/bb/ui/buildinfohelper.py8
-rw-r--r--lib/bb/ui/knotty.py2
-rw-r--r--lib/bb/ui/ncurses.py2
-rw-r--r--lib/bb/ui/taskexp.py2
-rw-r--r--lib/bb/ui/toasterui.py2
-rw-r--r--lib/bb/ui/uievent.py2
6 files changed, 9 insertions, 9 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 5cbca97f3..82c62e332 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -935,7 +935,7 @@ class BuildInfoHelper(object):
# only reset the build name if the one on the server is actually
# a valid value for the build_name field
- if build_name != None:
+ if build_name is not None:
build_info['build_name'] = build_name
changed = True
@@ -1194,7 +1194,7 @@ class BuildInfoHelper(object):
evdata = BuildInfoHelper._get_data_from_event(event)
for t in self.internal_state['targets']:
- if t.is_image == True:
+ if t.is_image:
output_files = list(evdata.keys())
for output in output_files:
if t.target in output and 'rootfs' in output and not output.endswith(".manifest"):
@@ -1236,7 +1236,7 @@ class BuildInfoHelper(object):
task_information['outcome'] = Task.OUTCOME_PREBUILT
else:
task_information['task_executed'] = True
- if 'noexec' in vars(event) and event.noexec == True:
+ if 'noexec' in vars(event) and event.noexec:
task_information['task_executed'] = False
task_information['outcome'] = Task.OUTCOME_EMPTY
task_information['script_type'] = Task.CODING_NA
@@ -1776,7 +1776,7 @@ class BuildInfoHelper(object):
image_file_extensions_unique = {}
image_fstypes = self.server.runCommand(
['getVariable', 'IMAGE_FSTYPES'])[0]
- if image_fstypes != None:
+ if image_fstypes is not None:
image_types_str = image_fstypes.strip()
image_file_extensions = re.sub(r' {2,}', ' ', image_types_str)
image_file_extensions_unique = set(image_file_extensions.split(' '))
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 19008a4ea..a0340dfc2 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -447,7 +447,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
if error:
logger.error("Command '%s' failed: %s" % (cmdline, error))
return 1
- elif ret != True:
+ elif not ret:
logger.error("Command '%s' failed: returned %s" % (cmdline, ret))
return 1
diff --git a/lib/bb/ui/ncurses.py b/lib/bb/ui/ncurses.py
index 49569e375..da4fbeabb 100644
--- a/lib/bb/ui/ncurses.py
+++ b/lib/bb/ui/ncurses.py
@@ -238,7 +238,7 @@ class NCursesUI:
if error:
print("Error running command '%s': %s" % (cmdline, error))
return
- elif ret != True:
+ elif not ret:
print("Couldn't get default commandlind! %s" % ret)
return
except xmlrpc.client.Fault as x:
diff --git a/lib/bb/ui/taskexp.py b/lib/bb/ui/taskexp.py
index 7895102b9..8fff24423 100644
--- a/lib/bb/ui/taskexp.py
+++ b/lib/bb/ui/taskexp.py
@@ -200,7 +200,7 @@ def main(server, eventHandler, params):
if error:
print("Error running command '%s': %s" % (cmdline, error))
return 1
- elif ret != True:
+ elif not ret:
print("Error running command '%s': returned %s" % (cmdline, ret))
return 1
except client.Fault as x:
diff --git a/lib/bb/ui/toasterui.py b/lib/bb/ui/toasterui.py
index 51892c9a0..9260f5d9d 100644
--- a/lib/bb/ui/toasterui.py
+++ b/lib/bb/ui/toasterui.py
@@ -176,7 +176,7 @@ def main(server, eventHandler, params):
if error:
logger.error("Command '%s' failed: %s" % (cmdline, error))
return 1
- elif ret != True:
+ elif not ret:
logger.error("Command '%s' failed: returned %s" % (cmdline, ret))
return 1
diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py
index fedb05064..13d0d4a04 100644
--- a/lib/bb/ui/uievent.py
+++ b/lib/bb/ui/uievent.py
@@ -46,7 +46,7 @@ class BBUIEventQueue:
self.EventHandle = ret
error = ""
- if self.EventHandle != None:
+ if self.EventHandle is not None:
break
errmsg = "Could not register UI event handler. Error: %s, host %s, "\