Skip to content

Commit

Permalink
Merge pull request #1554 from eric-wieser/patch-4
Browse files Browse the repository at this point in the history
Fix RecursionError when iterating streams
  • Loading branch information
Byron authored Feb 12, 2023
2 parents c84dde2 + 5ab58f3 commit 202e31c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,14 @@ def __iter__(self) -> "Git.CatFileContentStream":
return self

def __next__(self) -> bytes:
return next(self)

def next(self) -> bytes:
line = self.readline()
if not line:
raise StopIteration

return line

next = __next__

def __del__(self) -> None:
bytes_left = self._size - self._nbr
if bytes_left:
Expand Down

0 comments on commit 202e31c

Please sign in to comment.