From 1a28f290b8224eb1d78a2476faaedc5154f82208 Mon Sep 17 00:00:00 2001 From: J-Alves Date: Fri, 7 Oct 2022 10:02:33 +0100 Subject: [PATCH] fix(sptool): operators "is/is not" in sp_mk_gen.py Replace the "is/is not" operator by "==/!=" for literals, to fix the syntax warnings below: tools/sptool/sp_mk_generator.py:93: SyntaxWarning: "is not" with a literal. Did you mean "!="? return len(sppkg_rule) is not 0 tools/sptool/sp_mk_generator.py:203: SyntaxWarning: "is" with a literal. Did you mean "=="? assert(len(uuid_lines) is 1) Signed-off-by: J-Alves Change-Id: I10800f6b607942542aa2cbaaecac86b854f6b56a --- tools/sptool/sp_mk_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sptool/sp_mk_generator.py b/tools/sptool/sp_mk_generator.py index c0beb65e6..f3af584af 100644 --- a/tools/sptool/sp_mk_generator.py +++ b/tools/sptool/sp_mk_generator.py @@ -90,7 +90,7 @@ def get_sp_pkg(sp, args :dict): def is_line_in_sp_gen(line, args :dict): with open(args["sp_gen_mk"], "r") as f: sppkg_rule = [l for l in f if line in l] - return len(sppkg_rule) is not 0 + return len(sppkg_rule) != 0 def get_file_from_layout(node): ''' Helper to fetch a file path from sp_layout.json. ''' @@ -200,7 +200,7 @@ def gen_fiptool_args(sp_layout, sp, args :dict): else: with open(get_sp_manifest_full_path(sp_layout[sp], args), "r") as pm_f: uuid_lines = [l for l in pm_f if 'uuid' in l] - assert(len(uuid_lines) is 1) + assert(len(uuid_lines) == 1) # The uuid field in SP manifest is the little endian representation # mapped to arguments as described in SMCCC section 5.3. # Convert each unsigned integer value to a big endian representation