mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Make PathMatcher correctly exclude paths on windows / any OS without / seperators (#3837)
This commit is contained in:
@@ -61,6 +61,7 @@ def create_parser() -> argparse.ArgumentParser:
|
||||
|
||||
class PathMatcher:
|
||||
def __init__(self, patterns: Sequence[str]) -> None:
|
||||
patterns = [re.escape(os.path.join(*x.split("/"))) for x in patterns]
|
||||
self.matcher = re.compile(r"({})$".format("|".join(patterns))) if patterns else None
|
||||
|
||||
def search(self, path: str) -> Optional[Match[str]]:
|
||||
|
||||
Reference in New Issue
Block a user