Fix RequestIter.__next__ propagating StopAsyncIteration (#1117)

This commit is contained in:
Manuel1510 2019-02-28 08:07:31 +01:00 committed by Lonami
parent 8429f9bd3c
commit 70e0d865a8

View File

@ -81,7 +81,10 @@ class RequestIter(abc.ABC):
return result return result
def __next__(self): def __next__(self):
return self.client.loop.run_until_complete(self.__anext__()) try:
return self.client.loop.run_until_complete(self.__anext__())
except StopAsyncIteration:
raise StopIteration
def __aiter__(self): def __aiter__(self):
self.buffer = None self.buffer = None