summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildstream/_artifactcache/cascache.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 74422241c..4fea98626 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -845,6 +845,9 @@ class _CASRemote():
def _grouper(iterable, n):
- # pylint: disable=stop-iteration-return
while True:
- yield itertools.chain([next(iterable)], itertools.islice(iterable, n - 1))
+ try:
+ current = next(iterable)
+ except StopIteration:
+ return
+ yield itertools.chain([current], itertools.islice(iterable, n - 1))