From fa5524890e86d353ee7d2194ccdd6c84e9bd2d31 Mon Sep 17 00:00:00 2001 From: Frazer Clews Date: Thu, 16 Jan 2020 17:11:19 +0000 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/buildinfohelper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/ui/buildinfohelper.py') diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 5cbca97f3f..82c62e3324 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/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(' ')) -- cgit v1.2.3-54-g00ecf