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()
|
self.update()
|
||||||
|
|
||||||
def iter(self, it):
|
def iter(self, it):
|
||||||
for x in it:
|
try:
|
||||||
yield x
|
for x in it:
|
||||||
self.next()
|
yield x
|
||||||
self.finish()
|
self.next()
|
||||||
|
finally:
|
||||||
|
self.finish()
|
||||||
|
|
||||||
|
|
||||||
class Progress(Infinite):
|
class Progress(Infinite):
|
||||||
@@ -117,7 +119,9 @@ class Progress(Infinite):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for x in it:
|
try:
|
||||||
yield x
|
for x in it:
|
||||||
self.next()
|
yield x
|
||||||
self.finish()
|
self.next()
|
||||||
|
finally:
|
||||||
|
self.finish()
|
||||||
|
|||||||
Reference in New Issue
Block a user