Skip to content

Commit

Permalink
EventIterable: use looping instead of tail recursion in __next__() (#…
Browse files Browse the repository at this point in the history
…1126)

Fixes #1125

Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana authored Jul 7, 2021
1 parent a964d8c commit bec4e8e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions minio/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,10 +839,13 @@ def _get_records(self):
return None

def __next__(self):
if not self._response:
self._response = self._func()
self._stream = self._response.stream()
return self._get_records() or self.__next__()
records = None
while not records:
if not self._response:
self._response = self._func()
self._stream = self._response.stream()
records = self._get_records()
return records

def __enter__(self):
return self
Expand Down

0 comments on commit bec4e8e

Please sign in to comment.