Skip to content

Commit

Permalink
fix critical bug in text_reader.py: infinite loop when file_count inf…
Browse files Browse the repository at this point in the history
…o is -1
  • Loading branch information
ilius committed Feb 6, 2025
1 parent 26315f7 commit cdd5ddd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyglossary/text_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ def __iter__(self) -> Iterator[EntryType | None]:
try:
block = self.nextBlock()
except StopIteration:
if self._fileCount == -1 or (
self._fileIndex < self._fileCount - 1 and self.openNextFile()
):
if (
self._fileCount == -1 or self._fileIndex < self._fileCount - 1
) and self.openNextFile():
continue
self._wordCount = self._pos
break
Expand Down

0 comments on commit cdd5ddd

Please sign in to comment.