summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-09-27 10:02:54 -0700
committerGitHub <noreply@github.com>2021-09-27 10:02:54 -0700
commitfce9cb933845bf0b74d322eba02de3b76daaeb84 (patch)
treea28ffc6f3c53a4ddf1004f1a99938e2e5a42e6c3 /util
parent5f38a98fa07677be960b71b8e3b0a1785effe0d8 (diff)
Cleanup issues identified by lgtm (#14459)
* cleanup issues identified by lgtm * fix the git_status check
Diffstat (limited to 'util')
-rwxr-xr-xutil/stm32eeprom_parser.py1
-rwxr-xr-xutil/uf2conv.py8
2 files changed, 4 insertions, 5 deletions
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()