mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: 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. (Bitbake rev: b809a6812aa15a8a9af97bc382cc4b19571e6bfc) Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
0ac5174c7d
commit
fa5524890e
@@ -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(' '))
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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, "\
|
||||
|
||||
Reference in New Issue
Block a user