def _decode_stdoutdata(stdoutdata):
 if (not isinstance(stdoutdata, bytes)):
  return stdoutdata
 encoding = getattr(sys.__stdout__, 'encoding', locale.getpreferredencoding())
 if (encoding is None):
  return stdoutdata.decode()
 return stdoutdata.decode(encoding)

def _decode_stdoutdata ( stdoutdata ) : if ( not isinstance ( stdoutdata , bytes ) ) : return stdoutdata encoding = getattr ( sys . __stdout__ , 'encoding' , locale . getpreferredencoding ( ) ) if ( encoding is None ) : return stdoutdata . decode ( ) return stdoutdata . decode ( encoding )
convert data read from stdout/stderr to unicode .