Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Jul 12, 2024
1 parent ba1afd3 commit a724dc2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions typeshed_client/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,13 @@ def safe_is_file(path: Union[Path, _DirEntry]) -> bool:
return False


def safe_scandir(path: os.PathLike[str]) -> Iterable[_DirEntry]:
def safe_scandir(path: "os.PathLike[str]") -> Iterable[_DirEntry]:
"""Return an iterator over the entries in a directory, or no entries if we get an error."""
try:
return os.scandir(path)
with os.scandir(path) as sd:
yield from sd
except OSError:
return iter([])
pass


def get_stub_file_name(
Expand Down

0 comments on commit a724dc2

Please sign in to comment.