未验证 提交 1453bb8b 编写于 作者: B blue-fish 提交者: GitHub

Add progress bar exception for systems that do not support unicode (see #50, #89) (#372)

上级 32a59f39
......@@ -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) :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册