Skip to content

Commit 202e31c

Browse files
authored
Merge pull request #1554 from eric-wieser/patch-4
Fix RecursionError when iterating streams
2 parents c84dde2 + 5ab58f3 commit 202e31c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

git/cmd.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -695,15 +695,14 @@ def __iter__(self) -> "Git.CatFileContentStream":
695695
return self
696696

697697
def __next__(self) -> bytes:
698-
return next(self)
699-
700-
def next(self) -> bytes:
701698
line = self.readline()
702699
if not line:
703700
raise StopIteration
704701

705702
return line
706703

704+
next = __next__
705+
707706
def __del__(self) -> None:
708707
bytes_left = self._size - self._nbr
709708
if bytes_left:

0 commit comments

Comments
 (0)