fix UnicodeEncodeError

This commit is contained in:
Nurono 2016-11-23 12:48:09 +03:00
commit 5e1c64e61e

View file

@ -698,6 +698,8 @@ def write(colored, stream = sys.stdout):
""" """
Write "colored" on sys.stdout, then flush. Write "colored" on sys.stdout, then flush.
""" """
if isinstance(colored, unicode):
colored = colored.encode('utf-8')
try: try:
stream.write(colored) stream.write(colored)
stream.flush() stream.flush()