Skip to content

Commit

Permalink
catching GeneratorExit to make sure we always end clean to fix #212
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Nov 5, 2019
1 parent 0c4298e commit d038ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion progressbar/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ def __next__(self):
return value
except StopIteration:
self.finish()
raise
except GeneratorExit:
self.finish(dirty=True)

def __exit__(self, exc_type, exc_value, traceback):
self.finish(dirty=bool(exc_type))
Expand Down

0 comments on commit d038ce8

Please sign in to comment.