def to_string(stdoutbytes):
if sys.version_info[<NUM_LIT:0>] < <NUM_LIT:3>:<EOL><INDENT>return stdoutbytes<EOL><DEDENT>encoding = sys.stdout.encoding if sys.stdout.encoding else '<STR_LIT:utf-8>'<EOL>return stdoutbytes.decode(encoding)<EOL>
Convert stdout to a string in python 2 or 3.