Skip to content

Commit 9705f73

Browse files
Update data.py: use raw strings
1 parent 25b28c9 commit 9705f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/test/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def expand_errors(input: list[str], output: list[str], fnam: str) -> None:
533533

534534
for i in range(len(input)):
535535
# The first in the split things isn't a comment
536-
for possible_err_comment in re.split("(?!\\)#", input[i])[1:]:
536+
for possible_err_comment in re.split(r"(?!\\)#", input[i])[1:]:
537537
m = re.search(
538538
r"^([ENW]):((?P<col>\d+):)? (?P<message>.*)$", possible_err_comment.strip()
539539
)
@@ -546,7 +546,7 @@ def expand_errors(input: list[str], output: list[str], fnam: str) -> None:
546546
severity = "warning"
547547
col = m.group("col")
548548
message = m.group("message")
549-
message = message.replace("\\#", "#") # adds back escaped # character
549+
message = message.replace(r"\#", "#") # adds back escaped # character
550550
if col is None:
551551
output.append(f"{fnam}:{i + 1}: {severity}: {message}")
552552
else:

0 commit comments

Comments
 (0)