MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / call

Function call

etc/scripts/utils_thirdparty.py:2140–2162  ·  view source on GitHub ↗

Call args in a subprocess and display output on the fly if ``trace`` is True. Return a tuple of (returncode, stdout, stderr)

(args, verbose=TRACE)

Source from the content-addressed store, hash-verified

2138
2139
2140def call(args, verbose=TRACE):
2141 """
2142 Call args in a subprocess and display output on the fly if ``trace`` is True.
2143 Return a tuple of (returncode, stdout, stderr)
2144 """
2145 if TRACE_DEEP:
2146 print("Calling:", " ".join(args))
2147 with subprocess.Popen(
2148 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8"
2149 ) as process:
2150 stdouts = []
2151 while True:
2152 line = process.stdout.readline()
2153 if not line and process.poll() is not None:
2154 break
2155 stdouts.append(line)
2156 if verbose:
2157 print(line.rstrip(), flush=True)
2158
2159 stdout, stderr = process.communicate()
2160 if not stdout.strip():
2161 stdout = "\n".join(stdouts)
2162 return process.returncode, stdout, stderr
2163
2164
2165def download_wheels_with_pip(

Callers 1

download_wheels_with_pipFunction · 0.85

Calls 2

joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected