Skip to content

Commit be9f3cb

Browse files
committed
PARQUET-331: Surface subprocess stderr in merge script
This makes it a little easier to understand why the merge script failed Author: Alex Levenson <[email protected]> Closes #240 from isnotinvain/alexlevenson/merge-script-error-handling and squashes the following commits: 7c38c01 [Alex Levenson] Surface subprocess stderr in merge script
1 parent fcd5682 commit be9f3cb

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

dev/merge_parquet_pr.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,19 @@ def fail(msg):
7979

8080

8181
def run_cmd(cmd):
82-
if isinstance(cmd, list):
83-
return subprocess.check_output(cmd)
84-
else:
85-
return subprocess.check_output(cmd.split(" "))
86-
82+
try:
83+
if isinstance(cmd, list):
84+
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
85+
else:
86+
return subprocess.check_output(cmd.split(" "), stderr = subprocess.STDOUT)
87+
except subprocess.CalledProcessError as e:
88+
# this avoids hiding the stdout / stderr of failed processes
89+
print 'Command failed: %s' % cmd
90+
print 'With output:'
91+
print '--------------'
92+
print e.output
93+
print '--------------'
94+
raise e
8795

8896
def continue_maybe(prompt):
8997
result = raw_input("\n%s (y/n): " % prompt)

0 commit comments

Comments
 (0)