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):
w = buf[0:30].decode("utf-8")
except UnicodeDecodeError:
return False
- if w[0] == ':' and re.match(b"^[:0-9a-fA-F\r\n]+$", buf):
+ if w[0] == ':' and re.match(rb"^[:0-9a-fA-F\r\n]+$", buf):
return True
return False
@@ -214,7 +214,7 @@ def get_drives():
"get", "DeviceID,", "VolumeName,",
"FileSystem,", "DriveType"])
for line in to_str(r).split('\n'):
- words = re.split('\s+', line)
+ words = re.split(r'\s+', line)
if len(words) >= 3 and words[1] == "2" and words[2] == "FAT":
drives.append(words[0])
else:
@@ -243,7 +243,7 @@ def get_drives():
def board_id(path):
with open(path + INFO_FILE, mode='r') as file:
file_content = file.read()
- return re.search("Board-ID: ([^\r\n]*)", file_content).group(1)
+ return re.search(r"Board-ID: ([^\r\n]*)", file_content).group(1)
def list_drives():