From fce9cb933845bf0b74d322eba02de3b76daaeb84 Mon Sep 17 00:00:00 2001 From: Zach White Date: Mon, 27 Sep 2021 10:02:54 -0700 Subject: Cleanup issues identified by lgtm (#14459) * cleanup issues identified by lgtm * fix the git_status check --- util/stm32eeprom_parser.py | 1 - util/uf2conv.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'util') diff --git a/util/stm32eeprom_parser.py b/util/stm32eeprom_parser.py index b124f713d5..e08b67064b 100755 --- a/util/stm32eeprom_parser.py +++ b/util/stm32eeprom_parser.py @@ -197,7 +197,6 @@ def dumpBinary(data, canonical): print("") size = len(data) - empty_rows = 0 prev_row = '' first_repeat = True for pos in range(0, size, 16): diff --git a/util/uf2conv.py b/util/uf2conv.py index 044a7f2318..8677a828c9 100755 --- a/util/uf2conv.py +++ b/util/uf2conv.py @@ -78,7 +78,7 @@ def convert_from_uf2(buf): if datalen > 476: assert False, "Invalid UF2 data size at " + ptr newaddr = hd[3] - if curraddr == None: + if curraddr is None: appstartaddr = newaddr curraddr = newaddr padding = newaddr - curraddr @@ -171,7 +171,7 @@ def convert_from_hex_to_uf2(buf): break elif tp == 0: addr = upper | (rec[1] << 8) | rec[2] - if appstartaddr == None: + if appstartaddr is None: appstartaddr = addr i = 4 while i < len(rec) - 1: @@ -215,7 +215,7 @@ def get_drives(): def has_info(d): try: return os.path.isfile(d + INFO_FILE) - except: + except Exception: return False return list(filter(has_info, drives)) @@ -300,7 +300,7 @@ def main(): (ext, len(outbuf), appstartaddr)) if args.convert or ext != "uf2": drives = [] - if args.output == None: + if args.output is None: args.output = "flash." + ext else: drives = get_drives() -- cgit v1.2.3