Fix itershuffle

This commit is contained in:
Matthew Honnibal 2018-03-10 22:32:59 +01:00
parent b59765ca9f
commit 31b156d60b

View File

@ -451,7 +451,7 @@ def itershuffle(iterable, bufsize=1000):
try:
while True:
for i in range(random.randint(1, bufsize-len(buf))):
buf.append(iterable.next())
buf.append(next(iterable))
random.shuffle(buf)
for i in range(random.randint(1, bufsize)):
if buf: