Fix sys.stdout.encoding error

This commit is contained in:
Phyks 2014-08-03 21:37:34 +02:00
parent 3c88752cf9
commit a07c2ea292

View File

@ -31,8 +31,10 @@ from libbmc.config import Config
config = Config() config = Config()
default_socket = socket.socket default_socket = socket.socket
try:
stdout_encoding = sys.stdout.encoding stdout_encoding = sys.stdout.encoding
if stdout_encoding is None: assert(stdout_encoding is not None)
except (AttributeError, AssertionError):
stdout_encoding = 'UTF-8' stdout_encoding = 'UTF-8'