(cmd, cwd)
return (p.returncode, out, err)
execute a command at a low level. returns (returncode, stdout, stderr).
    re-raises any exceptions
execute a command at a low level. returns (returncode, stdout, stderr).
    re-raises any exceptions
execute a command at a low level . returns ( returncode stdout stderr ) . re - raises any exceptions
def shell_exec_raw(cmd, cwd):
    """execute a command at a low level. returns (returncode, stdout, stderr).
    re-raises any exceptions"""
    def process_output(raw):
        output = raw.split('\n')
        if not output[-1]:
            del output[-1]
        return output

    p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True, cwd=cwd, env=make_env())
    out, err = [process_output(data) for data in p.communicate()]
    return (p.returncode, out, err)
def shell_exec_raw ( cmd , cwd ) : def process_output ( raw ) : output = raw . split ( '\n' ) if not output [ - 1 ] : del output [ - 1 ] return output p = Popen ( cmd , stdout = PIPE , stderr = PIPE , shell = True , cwd = cwd , env = make_env ( ) ) out , err = [ process_output ( data ) for data in p . communicate ( ) ] return ( p . returncode , out , err )