mirror of
https://github.com/verigak/progress.git
synced 2025-12-08 19:33:24 +00:00
Merge branch 'pr/15'
This commit is contained in:
@@ -73,10 +73,12 @@ class Infinite(object):
|
||||
self.update()
|
||||
|
||||
def iter(self, it):
|
||||
for x in it:
|
||||
yield x
|
||||
self.next()
|
||||
self.finish()
|
||||
try:
|
||||
for x in it:
|
||||
yield x
|
||||
self.next()
|
||||
finally:
|
||||
self.finish()
|
||||
|
||||
|
||||
class Progress(Infinite):
|
||||
@@ -117,7 +119,9 @@ class Progress(Infinite):
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
for x in it:
|
||||
yield x
|
||||
self.next()
|
||||
self.finish()
|
||||
try:
|
||||
for x in it:
|
||||
yield x
|
||||
self.next()
|
||||
finally:
|
||||
self.finish()
|
||||
|
||||
Reference in New Issue
Block a user