archive: closely wrap next() called from generator

lgtm:
Calling next() in a generator may cause unintended early termination of
an iteration.

It seems that lgtm did not detect the more loose wrapping that we used
before.
This commit is contained in:
Thomas Waldmann 2017-07-22 02:42:12 +02:00
parent 5cc2b900ee
commit 199f192a65

View file

@ -172,11 +172,11 @@ backup_io = BackupIO()
def backup_io_iter(iterator):
backup_io.op = 'read'
while True:
try:
with backup_io:
with backup_io:
try:
item = next(iterator)
except StopIteration:
return
except StopIteration:
return
yield item