Skip to content

Commit

Permalink
chore: remove unused codepath
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Jan 11, 2024
1 parent a7316af commit a84fe62
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions pathy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
IO,
Any,
Callable,
ContextManager,
Dict,
Generator,
Iterator,
Expand Down Expand Up @@ -814,14 +813,8 @@ def symlink_to(
raise NotImplementedError(message)


class PathyScanDir(Iterator[Any], ContextManager[Any], ABC):
"""A scandir implementation that works for all python 3.x versions.
Python < 3.7 requires that scandir be iterable so it can be converted
to a list of results.
Python >= 3.8 requires that scandir work as a context manager.
"""
class PathyScanDir(Iterator[Any], ABC):
"""A scandir implementation that works for all python 3.x versions."""

def __init__(
self,
Expand All @@ -837,12 +830,6 @@ def __init__(
self._delimiter = delimiter
self._generator = self.scandir()

def __enter__(self) -> Generator[BucketEntry, None, None]:
return self._generator

def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
pass

def __next__(self) -> Generator[BucketEntry, None, None]:
yield from self._generator

Expand Down

0 comments on commit a84fe62

Please sign in to comment.