Skip to content

Commit

Permalink
Fix progress bar error on windows (blei-lab#849)
Browse files Browse the repository at this point in the history
Resolves blei-lab#790
  • Loading branch information
abs51295 authored and dustinvtran committed Feb 7, 2018
1 parent 27eefa0 commit fc31d02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion edward/util/progbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def update(self, current, values=None, force=False):
bar += ' '
prog_width = int(self.width * float(current) / self.target)
if prog_width > 0:
bar += ('█' * prog_width)
try:
bar += ('█' * prog_width)
except UnicodeEncodeError:
bar += ('*' * prog_width)

bar += (' ' * (self.width - prog_width))
sys.stdout.write(bar)
Expand Down

0 comments on commit fc31d02

Please sign in to comment.