Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Escape filenames before injecting into MYPY_ERROR_TEMPLATE #17

Merged
merged 1 commit into from
Jun 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flake8_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def build_mypy_re(self, filename: Union[str, Path]) -> Pattern:
except ValueError:
pass # not relative to the cwd

re_filename = str(filename).replace('.', r'\.')
re_filename = re.escape(str(filename))
if re_filename.startswith(r'\./'):
re_filename = re_filename[3:]
return re.compile(
Expand Down