fix UnicodeEncodeError
This commit is contained in:
parent
01d1ab6b20
commit
5e1c64e61e
1 changed files with 2 additions and 0 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue