use ichunked instead of chunked.
This commit is contained in:
parent
37d095199a
commit
0fbe788e31
@ -21,7 +21,7 @@ import mwreverts
|
|||||||
import mwxml
|
import mwxml
|
||||||
import pywikidiff2
|
import pywikidiff2
|
||||||
from deltas.tokenizers import wikitext_split
|
from deltas.tokenizers import wikitext_split
|
||||||
from more_itertools import chunked
|
from more_itertools import ichunked
|
||||||
from mwxml import Dump
|
from mwxml import Dump
|
||||||
|
|
||||||
import wikiq.tables as tables
|
import wikiq.tables as tables
|
||||||
@ -456,7 +456,7 @@ class WikiqParser:
|
|||||||
reverts_column.rev_detector = None
|
reverts_column.rev_detector = None
|
||||||
|
|
||||||
# Iterate through a page's revisions
|
# Iterate through a page's revisions
|
||||||
batches = chunked(page, self.batch_size)
|
batches = ichunked(page, self.batch_size)
|
||||||
last_rev_text = ""
|
last_rev_text = ""
|
||||||
last_rev_id = None
|
last_rev_id = None
|
||||||
row_buffer = None
|
row_buffer = None
|
||||||
@ -498,7 +498,7 @@ class WikiqParser:
|
|||||||
# second loop: next_batch <- batch; evaluate next_batch.
|
# second loop: next_batch <- batch; evaluate next_batch.
|
||||||
# final loop: on_last_batch <- true; evaluate next_batch
|
# final loop: on_last_batch <- true; evaluate next_batch
|
||||||
try:
|
try:
|
||||||
batch = next(batches)
|
batch = list(next(batches))
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
on_last_batch = True
|
on_last_batch = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user