summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-02-28 09:29:00 +0000
committerGitHub <noreply@github.com>2024-02-28 20:29:00 +1100
commit51cfd7554a7736225daf93949e47ee17b80ee32c (patch)
tree8a169a901b00a6c4fce5805b3da8d6fbc5af5a6e /util
parentb3462157dc2fb5d029f12bf9ecc8ae1d0340e8dd (diff)
Merge upstream uf2conv.py changes (#23163)
Diffstat (limited to 'util')
-rwxr-xr-xutil/uf2conv.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/uf2conv.py b/util/uf2conv.py
index 84271cee4f..67cf92f169 100755
--- a/util/uf2conv.py
+++ b/util/uf2conv.py
@@ -30,7 +30,7 @@ def is_hex(buf):
30 w = buf[0:30].decode("utf-8") 30 w = buf[0:30].decode("utf-8")
31 except UnicodeDecodeError: 31 except UnicodeDecodeError:
32 return False 32 return False
33 if w[0] == ':' and re.match(b"^[:0-9a-fA-F\r\n]+$", buf): 33 if w[0] == ':' and re.match(rb"^[:0-9a-fA-F\r\n]+$", buf):
34 return True 34 return True
35 return False 35 return False
36 36
@@ -214,7 +214,7 @@ def get_drives():
214 "get", "DeviceID,", "VolumeName,", 214 "get", "DeviceID,", "VolumeName,",
215 "FileSystem,", "DriveType"]) 215 "FileSystem,", "DriveType"])
216 for line in to_str(r).split('\n'): 216 for line in to_str(r).split('\n'):
217 words = re.split('\s+', line) 217 words = re.split(r'\s+', line)
218 if len(words) >= 3 and words[1] == "2" and words[2] == "FAT": 218 if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
219 drives.append(words[0]) 219 drives.append(words[0])
220 else: 220 else:
@@ -243,7 +243,7 @@ def get_drives():
243def board_id(path): 243def board_id(path):
244 with open(path + INFO_FILE, mode='r') as file: 244 with open(path + INFO_FILE, mode='r') as file:
245 file_content = file.read() 245 file_content = file.read()
246 return re.search("Board-ID: ([^\r\n]*)", file_content).group(1) 246 return re.search(r"Board-ID: ([^\r\n]*)", file_content).group(1)
247 247
248 248
249def list_drives(): 249def list_drives():