Commit 69cdebac by Mikhail Korobov

Fix _decode_stdoutdata utility for Python 3.2. See GH-788.

parent 532fda0d
...@@ -650,6 +650,8 @@ def _decode_stdoutdata(stdoutdata): ...@@ -650,6 +650,8 @@ def _decode_stdoutdata(stdoutdata):
if not isinstance(stdoutdata, bytes): if not isinstance(stdoutdata, bytes):
return stdoutdata return stdoutdata
encoding = getattr(sys.stdout, "encoding", locale.getpreferredencoding()) encoding = getattr(sys.stdout, "encoding", locale.getpreferredencoding())
if encoding is None:
return stdoutdata.decode()
return stdoutdata.decode(encoding) return stdoutdata.decode(encoding)
########################################################################## ##########################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment