MCPcopy Create free account
hub / github.com/apache/arrow / run_cmd

Function run_cmd

dev/merge_arrow_pr.py:86–103  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

84
85
86def run_cmd(cmd):
87 if isinstance(cmd, str):
88 cmd = cmd.split(' ')
89
90 try:
91 output = subprocess.check_output(cmd)
92 except subprocess.CalledProcessError as e:
93 # this avoids hiding the stdout / stderr of failed processes
94 print('Command failed: %s' % cmd)
95 print('With output:')
96 print('--------------')
97 print(e.output)
98 print('--------------')
99 raise e
100
101 if isinstance(output, bytes):
102 output = output.decode('utf-8')
103 return output
104
105
106_REGEX_CI_DIRECTIVE = re.compile(r'\[[^\]]*\]')

Callers 1

mergeMethod · 0.70

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected