@@ -264,9 +264,7 @@ def has_shell_timeout():
264264
265265try :
266266 if NODEJS is not None :
267- subprocess .check_call ([NODEJS , '--version' ],
268- stdout = subprocess .PIPE ,
269- stderr = subprocess .PIPE )
267+ subprocess .run ([NODEJS , '--version' ], check = True , capture_output = True )
270268except (OSError , subprocess .CalledProcessError ):
271269 NODEJS = None
272270if NODEJS is None :
@@ -314,12 +312,9 @@ def __init__(self, returncode, cmd, output=None, stderr=None):
314312 self .stderr = stderr
315313
316314
317- def run_process (cmd , check = True , input = None , capture_output = False , decode_output = True , * args , ** kw ):
315+ def run_process (cmd , check = True , input = None , decode_output = True , * args , ** kw ):
318316 if input and type (input ) is str :
319317 input = bytes (input , 'utf-8' )
320- if capture_output :
321- kw ['stdout' ] = subprocess .PIPE
322- kw ['stderr' ] = subprocess .PIPE
323318 ret = subprocess .run (cmd , check = check , input = input , * args , ** kw )
324319 if decode_output and ret .stdout is not None :
325320 ret .stdout = ret .stdout .decode ('utf-8' )
@@ -557,9 +552,8 @@ def minify_check(wast, verify_final_result=True):
557552 print (' (minify check)' )
558553 cmd = WASM_OPT + [wast , '--print-minified' , '-all' ]
559554 print (' ' , ' ' .join (cmd ))
560- subprocess .check_call (cmd , stdout = open ('a.wast' , 'w' ), stderr = subprocess .PIPE )
561- subprocess .check_call (WASM_OPT + ['a.wast' , '-all' ],
562- stdout = subprocess .PIPE , stderr = subprocess .PIPE )
555+ subprocess .run (cmd , stdout = open ('a.wast' , 'w' ), check = True , stderr = subprocess .PIPE )
556+ subprocess .run (WASM_OPT + ['a.wast' , '-all' ], check = True , capture_output = True )
563557
564558
565559# run a check with BINARYEN_PASS_DEBUG set, to do full validation
0 commit comments