From b7fc2f479f7756f8d4bc6fdb03eeb195db8dbe23 Mon Sep 17 00:00:00 2001 From: ferkans-amir Date: Tue, 28 Jul 2026 10:24:45 +0200 Subject: [PATCH] fix(modulefinder): use subpath instead of relative_path in fscache.isdir check in matches_gitignore --- mypy/modulefinder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py index baa521afbb122..c5ec268752c6c 100644 --- a/mypy/modulefinder.py +++ b/mypy/modulefinder.py @@ -711,7 +711,7 @@ def matches_gitignore(subpath: str, fscache: FileSystemCache, verbose: bool) -> dir, _ = os.path.split(subpath) for gi_path, gi_spec in find_gitignores(dir): relative_path = os.path.relpath(subpath, gi_path) - if fscache.isdir(relative_path): + if fscache.isdir(subpath): relative_path = relative_path + "/" if gi_spec.match_file(relative_path): if verbose: