mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
Replace bytes | str | Path with StrOrBytesPath
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
This commit is contained in:
parent
530512f699
commit
f2228e0a7c
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user