Skip to content

Commit

Permalink
revert flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
chillymosh committed May 18, 2024
1 parent cb486b8 commit f9f1cb4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions twitchio/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,10 @@ async def _do_conversion(self, data: RawResponse, *, raw: RawResponse) -> T:
return await self._converter(data, raw=raw)

async def _flatten(self) -> list[T]:
items: list[T] = [item async for item in self]
return items
if not self._buffer:
await self._call_next()

return list(self._buffer)

def __await__(self) -> Generator[Any, None, list[T]]:
return self._flatten().__await__()
Expand Down

0 comments on commit f9f1cb4

Please sign in to comment.