Skip to content

Commit 3b0b05d

Browse files
hauntsaninjaJukkaL
authored andcommitted
Use relative paths when matching exclude (#10078)
Co-authored-by: hauntsaninja <>
1 parent 28668c8 commit 3b0b05d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/modulefinder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def find_modules_recursive(self, module: str) -> List[BuildSource]:
413413
def matches_exclude(subpath: str, exclude: str, fscache: FileSystemCache, verbose: bool) -> bool:
414414
if not exclude:
415415
return False
416-
subpath_str = os.path.abspath(subpath).replace(os.sep, "/")
416+
subpath_str = os.path.relpath(subpath).replace(os.sep, "/")
417417
if fscache.isdir(subpath):
418418
subpath_str += "/"
419419
if re.search(exclude, subpath_str):

0 commit comments

Comments
 (0)