Skip to content

Commit

Permalink
Replace bytes | str | Path with StrOrBytesPath
Browse files Browse the repository at this point in the history
Co-authored-by: Ondrej Baranovič <[email protected]>
  • Loading branch information
hugovk and nulano authored Jan 31, 2024
1 parent 530512f commit f2228e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PIL/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f2228e0

Please sign in to comment.