diff --git a/mypy/test/update_data.py b/mypy/test/update_data.py index 84b6383b3f0cf..2e04444d56e09 100644 --- a/mypy/test/update_data.py +++ b/mypy/test/update_data.py @@ -64,7 +64,7 @@ def _iter_fixes( fix_lines = [] for lineno, source_line in enumerate(source_lines, start=1): reports = reports_by_line.get((file_path, lineno)) - comment_match = re.search(r"(?P\s+)(?P# [EWN]: .+)$", source_line) + comment_match = re.search(r"(?P\s+)(?P# ?[EWN]: .+)$", source_line) if comment_match: source_line = source_line[: comment_match.start("indent")] # strip old comment if reports: