summaryrefslogtreecommitdiff
path: root/util/uf2conv.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/uf2conv.py')
-rwxr-xr-xutil/uf2conv.py8
1 files changed, 4 insertions, 4 deletions
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()