Skip to content

Commit

Permalink
tools: make regex patterns raw strings
Browse files Browse the repository at this point in the history
Otherwise not all escape sequences are not recognized as character
classes.
  • Loading branch information
mweinelt committed Feb 14, 2025
1 parent a687a7b commit 4aed33d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions waftools/openocd.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _get_supported_interfaces(ctx):
out_lines = out.splitlines()
interfaces = []
for line in out_lines:
matches = re.search("\d+: (\w+)", line)
matches = re.search(r"\d+: (\w+)", line)
if matches:
interfaces.append(matches.groups()[0])
return interfaces
Expand All @@ -134,7 +134,7 @@ def get_flavor(conf):
quiet=waflib.Context.BOTH,
output=waflib.Context.STDERR)
version_string = version_string.splitlines()[0]
matches = re.search("(\d+)\.(\d+)\.(\d+)", version_string)
matches = re.search(r"(\d+)\.(\d+)\.(\d+)", version_string)
version = list(map(int, matches.groups()))
return (version[0] >= 0 and version[1] >= 7,
'pebble' in version_string)
Expand Down

0 comments on commit 4aed33d

Please sign in to comment.