Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94acd7d

Browse files
committed
Merge branch 'master' into ast-serialize-default-dep
2 parents f935f2b + 3b2b1dd commit 94acd7d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

mypy/modulefinder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from enum import Enum, unique
1616
from typing import Final, TypeAlias as _TypeAlias
1717

18-
from pathspec import PathSpec
18+
from pathspec import GitIgnoreSpec
1919
from pathspec.patterns.gitignore import GitIgnorePatternError
2020

2121
from mypy import pyinfo
@@ -724,7 +724,7 @@ def matches_gitignore(subpath: str, fscache: FileSystemCache, verbose: bool) ->
724724

725725

726726
@functools.lru_cache
727-
def find_gitignores(dir: str) -> list[tuple[str, PathSpec]]:
727+
def find_gitignores(dir: str) -> list[tuple[str, GitIgnoreSpec]]:
728728
parent_dir = os.path.dirname(dir)
729729
if parent_dir == dir or os.path.exists(os.path.join(dir, ".git")):
730730
parent_gitignores = []
@@ -733,7 +733,7 @@ def find_gitignores(dir: str) -> list[tuple[str, PathSpec]]:
733733
with open(git_info_exclude) as f:
734734
exclude_lines = f.readlines()
735735
try:
736-
parent_gitignores = [(dir, PathSpec.from_lines("gitignore", exclude_lines))]
736+
parent_gitignores = [(dir, GitIgnoreSpec.from_lines("gitignore", exclude_lines))]
737737
except GitIgnorePatternError:
738738
print(f"error: could not parse {git_info_exclude}", file=sys.stderr)
739739
else:
@@ -744,7 +744,7 @@ def find_gitignores(dir: str) -> list[tuple[str, PathSpec]]:
744744
with open(gitignore) as f:
745745
lines = f.readlines()
746746
try:
747-
return parent_gitignores + [(dir, PathSpec.from_lines("gitignore", lines))]
747+
return parent_gitignores + [(dir, GitIgnoreSpec.from_lines("gitignore", lines))]
748748
except GitIgnorePatternError:
749749
print(f"error: could not parse {gitignore}", file=sys.stderr)
750750
return parent_gitignores

0 commit comments

Comments
 (0)