Skip to content

Commit

Permalink
Fix RecursionError when iterating streams
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser authored Feb 12, 2023
1 parent c84dde2 commit 5cbc178
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,15 +695,15 @@ 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

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

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

0 comments on commit 5cbc178

Please sign in to comment.