Skip to content

Commit

Permalink
Merge pull request python-pillow#8259 from hugovk/rm-is_directory
Browse files Browse the repository at this point in the history
Remove unused _util.is_directory
  • Loading branch information
radarhere authored Jul 24, 2024
2 parents 61001da + 7a570d6 commit 6dd4b3c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
22 changes: 0 additions & 22 deletions Tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ def test_is_not_path(tmp_path: Path) -> None:
assert not it_is_not


def test_is_directory() -> None:
# Arrange
directory = "Tests"

# Act
it_is = _util.is_directory(directory)

# Assert
assert it_is


def test_is_not_directory() -> None:
# Arrange
text = "abc"

# Act
it_is_not = _util.is_directory(text)

# Assert
assert not it_is_not


def test_deferred_error() -> None:
# Arrange

Expand Down
5 changes: 0 additions & 5 deletions src/PIL/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ def is_path(f: Any) -> TypeGuard[StrOrBytesPath]:
return isinstance(f, (bytes, str, os.PathLike))


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)


class DeferredError:
def __init__(self, ex: BaseException):
self.ex = ex
Expand Down

0 comments on commit 6dd4b3c

Please sign in to comment.