Skip to content

Commit 5cbc178

Browse files
authored
Fix RecursionError when iterating streams
1 parent c84dde2 commit 5cbc178

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git/cmd.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -695,15 +695,15 @@ 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+
def next(self) -> bytes:
705+
return next(self)
706+
707707
def __del__(self) -> None:
708708
bytes_left = self._size - self._nbr
709709
if bytes_left:

0 commit comments

Comments
 (0)