1
0
Fork 0

Cleanup issues identified by lgtm (#14459)

* cleanup issues identified by lgtm

* fix the git_status check
This commit is contained in:
Zach White 2021-09-27 10:02:54 -07:00 committed by GitHub
parent 5f38a98fa0
commit fce9cb9338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 24 additions and 42 deletions

View file

@ -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()