Replace bytes | str | Path with StrOrBytesPath

Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
This commit is contained in:
Hugo van Kemenade 2024-01-31 12:37:53 -07:00 committed by GitHub
parent 530512f699
commit f2228e0a7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ def is_path(f: Any) -> TypeGuard[StrOrBytesPath]:
return isinstance(f, (bytes, str, os.PathLike))
def is_directory(f: Any) -> TypeGuard[bytes | str | Path]:
def is_directory(f: Any) -> TypeGuard[StrOrBytesPath]:
"""Checks if an object is a string, and that it points to a directory."""
return is_path(f) and os.path.isdir(f)