Skip to content

Commit 376c81e

Browse files
Let any unescaped # character terminate a comment
1 parent 4d72ec8 commit 376c81e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mypy/test/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def expand_errors(input: list[str], output: list[str], fnam: str) -> None:
547547
# The first in the split things isn't a comment
548548
for possible_err_comment in re.split(r"(?!\\)#\s*(?=[ENW]\s*:)", input[i])[1:]:
549549
m = re.search(
550-
r"^([ENW])\s*:((?P<col>\d+):)?(?P<message>.*)$", possible_err_comment.strip()
550+
r"^([ENW])\s*:((?P<col>\d+):)?(?P<message>(?:\\#|[^#])*)$", possible_err_comment.strip()
551551
)
552552
if m:
553553
if m.group(1) == "E":

0 commit comments

Comments
 (0)