MCPcopy Create free account
hub / github.com/pytorch/executorch / run

Function run

util/collect_env.py:101–115  ·  view source on GitHub ↗

Return (return-code, stdout, stderr).

(command)

Source from the content-addressed store, hash-verified

99
100
101def run(command):
102 """Return (return-code, stdout, stderr)."""
103 shell = True if type(command) is str else False
104 p = subprocess.Popen(
105 command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell
106 )
107 raw_output, raw_err = p.communicate()
108 rc = p.returncode
109 if get_platform() == "win32":
110 enc = "oem"
111 else:
112 enc = locale.getpreferredencoding()
113 output = raw_output.decode(enc)
114 err = raw_err.decode(enc)
115 return rc, output.strip(), err.strip()
116
117
118def run_and_read_all(run_lambda, command):

Callers

nothing calls this directly

Calls 2

get_platformFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected