From 0fbe788e318434c4c13977f39b43c9b2abc01639 Mon Sep 17 00:00:00 2001 From: Nathan TeBlunthuis Date: Tue, 15 Jul 2025 18:25:44 -0700 Subject: [PATCH] use ichunked instead of chunked. --- src/wikiq/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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