diff --git a/flake8_mypy.py b/flake8_mypy.py index 5560f2b..efb08ad 100644 --- a/flake8_mypy.py +++ b/flake8_mypy.py @@ -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(