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()
default_socket = socket.socket
stdout_encoding = sys.stdout.encoding
if stdout_encoding is None:
try:
stdout_encoding = sys.stdout.encoding
assert(stdout_encoding is not None)
except (AttributeError, AssertionError):
stdout_encoding = 'UTF-8'