Skip to content

Commit

Permalink
Merge pull request #9267 from dhalbert/fix-re-escape-warnings
Browse files Browse the repository at this point in the history
fix a few regexps that are better as raw strings
  • Loading branch information
tannewt authored May 22, 2024
2 parents 02f106f + 16e9fe6 commit 1382006
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/ci_fetch_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def _git_version():
version_str = subprocess.check_output(["git", "--version"], encoding="ascii", errors="replace")
version_str = re.search("([0-9]\.*)*[0-9]", version_str).group(0)
version_str = re.search(r"([0-9]\.*)*[0-9]", version_str).group(0)
return tuple(int(part) for part in version_str.split("."))


Expand Down
2 changes: 1 addition & 1 deletion tools/fwsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

for fn in os.listdir():
if os.path.isfile(fn) and ("build-arm " in fn or "build-riscv " in fn):
board = re.split("[()]", fn)[1]
board = re.split(r"[()]", fn)[1]
if board in (
"spresense",
"teensy40",
Expand Down
2 changes: 1 addition & 1 deletion tools/gen_ld_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
defines = {}

#
REMOVE_UL_RE = re.compile("([0-9]+)UL")
REMOVE_UL_RE = re.compile(r"([0-9]+)UL")


def remove_UL(s):
Expand Down
2 changes: 1 addition & 1 deletion tools/hci_trace_to_pcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
with open(sys.argv[1], "r") as f:
for line in f:
line = line.strip()
m = re.match("([<>]) \\[ *([0-9]+)\\] ([A-Fa-f0-9:]+)", line)
m = re.match(r"([<>]) \[ *([0-9]+)\] ([A-Fa-f0-9:]+)", line)
if not m:
continue

Expand Down

0 comments on commit 1382006

Please sign in to comment.