Skip to content

Commit

Permalink
Use idiom from CPython
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelorenzo committed Aug 10, 2021
1 parent d2c787f commit d74a449
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions aiopath/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async def _iterate_directories(

async for p in self._iterate_directories(path, is_dir, scandir):
yield p

except PermissionError:
return

Expand Down Expand Up @@ -168,14 +169,11 @@ async def _select_from(
return


def _make_selector(pattern_parts: list[str], flavour: _Flavour) -> _AsyncSelector:
pat: str
child_parts: tuple[str] # needs to be hashable
def _make_selector(pattern_parts: tuple[str], flavour: _Flavour) -> _AsyncSelector:
pat: str = pattern_parts[0]
child_parts: tuple[str] = pattern_parts[1:]
cls: type

pat, *child_parts = pattern_parts
child_parts = tuple(child_parts)

if pat == '**':
cls = _RecursiveWildcardSelector

Expand Down

0 comments on commit d74a449

Please sign in to comment.