def METHOD_NAME(command, cwd=None, env=None):
    command = ' '.join(command)
    p = subprocess.Popen(command, cwd=cwd,
                        shell=True,
                        stdin=subprocess.PIPE,
                        stdout=subprocess.PIPE,
                        stderr=subprocess.PIPE,
                        env=env,
                        # Close extra file handles on UNIX (on Windows this cannot be done while
                        # also redirecting input). Taef only run on windows.
                        close_fds=False)
    out,err = p.communicate()
    exitCode = p.wait()
    # Detect Ctrl-C in subprocess.
    if exitCode == -signal.SIGINT:
        raise KeyboardInterrupt
    # Ensure the resulting output is always of string type.
    out = lit.util.convert_string(out)
    err = lit.util.convert_string(err)
    return out, err, exitCode