def run_proc(proc, retcode, timeout = None):
    _register_proc_timeout(proc, timeout)
    stdout, stderr = proc.communicate()
    proc._end_time = time.time()
    if not stdout:
        stdout = six.b("")
    if not stderr:
        stderr = six.b("")
    if getattr(proc, "encoding", None):
        stdout = stdout.decode(proc.encoding, "ignore")
        stderr = stderr.decode(proc.encoding, "ignore")

    return _check_process(proc, retcode, timeout, stdout, stderr)


#===================================================================================================
# iter_lines
#===================================================================================================
For the previous version of Betamax and backwards compatibility.
dataset/ETHPy150Open tomerfiliba/plumbum/plumbum/commands/processes.py/run_proc--crossover with--dataset/ETHPy150Open sigmavirus24/betamax/tests/unit/test_cassette.py/TestSerialization.test_deserialize_response_old