Skip to content

Commit

Permalink
Merge upstream uf2conv.py changes (qmk#23163)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and peepeetee committed Mar 12, 2024
1 parent 2c22048 commit dd39059
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/uf2conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -243,7 +243,7 @@ def has_info(d):
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():
Expand Down

0 comments on commit dd39059

Please sign in to comment.