diff --git a/git/cmd.py b/git/cmd.py index 134001e22..dfce9024d 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -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: