(path: Path, exclusions: Iterable[str])
return False
Return True if path matches any of the `exclude` paths passed by the user. False otherwise.
Return True if path matches any of the `exclude` paths passed by the user. False otherwise.
Return True if path matches any of the exclude paths passed by the user . False otherwise .
def _excluded(path: Path, exclusions: Iterable[str]) -> bool:
    """Return True if path matches any of the `exclude` paths passed by the user. False otherwise."""
    for exclude in exclusions:
        exclusion_path = Path(exclude)
        if exclusion_path == path:
            return True

        try:
            path.resolve().relative_to(exclusion_path.resolve())
        except ValueError:
            # We need to look at the rest of the exclusions
            # to see if they match, so move on to the next one.
            continue
        else:
            return True

    return False
def _excluded ( path : Path , exclusions : Iterable [ str ] ) -> bool : for exclude in exclusions : exclusion_path = Path ( exclude ) if exclusion_path == path : return True try : path . resolve ( ) . relative_to ( exclusion_path . resolve ( ) ) except ValueError : # We need to look at the rest of the exclusions # to see if they match, so move on to the next one. continue else : return True return False