def run_setup_py(cmd, pypath=None, path=None,<EOL>data_stream=<NUM_LIT:0>, env=None):
if env is None:<EOL><INDENT>env = dict()<EOL>for envname in os.environ:<EOL><INDENT>env[envname] = os.environ[envname]<EOL><DEDENT><DEDENT>if pypath is not None:<EOL><INDENT>env["<STR_LIT>"] = pypath<EOL><DEDENT>if path is not None:<EOL><INDENT>env["<STR_LIT>"] = path<EOL><DEDENT>if not env.get("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>env["<STR_LIT>"] = _which_dirs("<STR_LIT>").union(_which_dirs("<STR_LIT>"))<EOL>env["<STR_LIT>"] = os.pathsep.join(env["<STR_LIT>"])<EOL><DEDENT>cmd = [sys.executable, "<STR_LIT>"] + list(cmd)<EOL>shell = sys.platform == '<STR_LIT:win32>'<EOL>try:<EOL><INDENT>proc = _Popen(<EOL>cmd, stdout=_PIPE, stderr=_PIPE, shell=shell, env=env,<EOL>)<EOL>data = proc.communicate()[data_stream]<EOL><DEDENT>except OSError:<EOL><INDENT>return <NUM_LIT:1>, '<STR_LIT>'<EOL><DEDENT>if hasattr(data,  "<STR_LIT>"):<EOL><INDENT>data = data.decode()<EOL>data = unicodedata.normalize('<STR_LIT>', data)<EOL><DEDENT>return proc.returncode, data<EOL>
Execution command for tests, separate from those used by the
code directly to prevent accidental behavior issues