Skip to content

Fix RecursionError when iterating streams #1554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix RecursionError when iterating streams
  • Loading branch information
eric-wieser authored Feb 12, 2023
commit 5cbc1782e79783fbfedf5783fe52616e397916df
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