File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,19 @@ def fail(msg):
7979
8080
8181def 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
8896def continue_maybe (prompt ):
8997 result = raw_input ("\n %s (y/n): " % prompt )
You can’t perform that action at this time.
0 commit comments