From a07c2ea292c210dd6b134b74b540592c95de664e Mon Sep 17 00:00:00 2001 From: Phyks Date: Sun, 3 Aug 2014 21:37:34 +0200 Subject: [PATCH] Fix sys.stdout.encoding error --- libbmc/fetcher.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libbmc/fetcher.py b/libbmc/fetcher.py index 146c2f5..3a26d74 100644 --- a/libbmc/fetcher.py +++ b/libbmc/fetcher.py @@ -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'