diff --git a/src/wikiq/__init__.py b/src/wikiq/__init__.py index 77fb954..a6fada2 100755 --- a/src/wikiq/__init__.py +++ b/src/wikiq/__init__.py @@ -21,7 +21,7 @@ import mwreverts import mwxml import pywikidiff2 from deltas.tokenizers import wikitext_split -from more_itertools import chunked +from more_itertools import ichunked from mwxml import Dump import wikiq.tables as tables @@ -456,7 +456,7 @@ class WikiqParser: reverts_column.rev_detector = None # Iterate through a page's revisions - batches = chunked(page, self.batch_size) + batches = ichunked(page, self.batch_size) last_rev_text = "" last_rev_id = None row_buffer = None @@ -498,7 +498,7 @@ class WikiqParser: # second loop: next_batch <- batch; evaluate next_batch. # final loop: on_last_batch <- true; evaluate next_batch try: - batch = next(batches) + batch = list(next(batches)) except StopIteration: on_last_batch = True