diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py index 00a0530e29d5..dfba9c8c7dc3 100644 --- a/mypy/modulefinder.py +++ b/mypy/modulefinder.py @@ -476,7 +476,7 @@ def find_modules_recursive(self, module: str) -> List[BuildSource]: def matches_exclude(subpath: str, exclude: str, fscache: FileSystemCache, verbose: bool) -> bool: if not exclude: return False - subpath_str = os.path.abspath(subpath).replace(os.sep, "/") + subpath_str = os.path.relpath(subpath).replace(os.sep, "/") if fscache.isdir(subpath): subpath_str += "/" if re.search(exclude, subpath_str):