Skip to content

Commit 49457de

Browse files
committed
fixup! Fix path filtering on Windows
1 parent 2e4e6f7 commit 49457de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sphinx_autobuild/filter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ def __repr__(self):
1818
f"regex_based={self.regex_based_patterns!r})"
1919
)
2020

21-
def __call__(self, path):
21+
def __call__(self, filename: str, /):
2222
"""Determine if 'path' should be ignored."""
23-
path = Path(path).resolve().as_posix()
23+
normalised_path = Path(filename).resolve().as_posix()
2424
# Any regular pattern matches.
2525
for pattern in self.regular_patterns:
2626
# separators are normalised before creating the IgnoreFilter
27-
if path.startswith(f"{pattern}/"):
27+
if normalised_path.startswith(f"{pattern}/"):
2828
return True
29-
if fnmatch.fnmatch(path, pattern):
29+
if fnmatch.fnmatch(normalised_path, pattern):
3030
return True
3131

3232
# Any regular expression matches.
3333
for regex in self.regex_based_patterns: # NoQA: SIM110
34-
if regex.search(path):
34+
if regex.search(normalised_path):
3535
return True
3636

3737
return False

0 commit comments

Comments
 (0)