Skip to content

Commit

Permalink
Add progress bar exception for systems that do not support unicode (see
Browse files Browse the repository at this point in the history
  • Loading branch information
blue-fish authored Jun 23, 2020
1 parent 32a59f3 commit 1453bb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vocoder/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ def progbar(i, n, size=16):


def stream(message) :
sys.stdout.write("\r{%s}" % message)
try:
sys.stdout.write("\r{%s}" % message)
except:
#Remove non-ASCII characters from message
message = ''.join(i for i in message if ord(i)<128)
sys.stdout.write("\r{%s}" % message)


def simple_table(item_tuples) :
Expand Down

0 comments on commit 1453bb8

Please sign in to comment.