From 5719ec2ea1f08325350a83a7ef44ee3121ecc77b Mon Sep 17 00:00:00 2001 From: godofredoc Date: Mon, 12 Sep 2022 14:29:04 -0700 Subject: [PATCH] Move subprocess.run to popen. (flutter/engine#36104) --- .../sky/tools/create_macos_gen_snapshots.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py b/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py index 52f29a73978..be93ced17d4 100755 --- a/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py +++ b/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py @@ -82,13 +82,19 @@ def generate_gen_snapshot(directory, destination): print('Cannot find gen_snapshot at %s' % gen_snapshot_dir) sys.exit(1) - result = subprocess.run([ + command = [ 'xcrun', 'bitcode_strip', '-r', gen_snapshot_dir, '-o', destination - ]) - if result.returncode != 0: + ] + process = subprocess.Popen( + command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE + ) + stdout, stderr = process.communicate() + exit_status = process.wait() + + if exit_status != 0: print( 'Error processing command with stdout[%s] and stderr[%s]' % - (result.stdout, result.stderr) + (stdout, stderr) ) return 1