Fix PendingDeprecationWarning in libbmc.tools.batch
This commit is contained in:
parent
89b9c1ed44
commit
0b59b46c25
@ -8,4 +8,4 @@ with scientific papers.
|
|||||||
# Global list of valid paper identifier types. See README.md.
|
# Global list of valid paper identifier types. See README.md.
|
||||||
__valid_identifiers__ = []
|
__valid_identifiers__ = []
|
||||||
|
|
||||||
__version__ = "0.2"
|
__version__ = "0.2.1"
|
||||||
|
@ -108,7 +108,10 @@ def batch(iterable, size):
|
|||||||
item = iter(iterable)
|
item = iter(iterable)
|
||||||
while True:
|
while True:
|
||||||
batch_iterator = islice(item, size)
|
batch_iterator = islice(item, size)
|
||||||
|
try:
|
||||||
yield chain([next(batch_iterator)], batch_iterator)
|
yield chain([next(batch_iterator)], batch_iterator)
|
||||||
|
except StopIteration:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def remove_urls(text):
|
def remove_urls(text):
|
||||||
|
Loading…
Reference in New Issue
Block a user