Skip to content

Commit 8a90fce

Browse files
committed
Use communicate instead of wait
To fix the script from hanging.
1 parent 394c453 commit 8a90fce

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/make-bundle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ def run(cmd):
5555
sys.stdout.write("Running cmd: %s\n" % cmd)
5656
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
5757
stderr=subprocess.PIPE)
58+
stdout, stderr = p.communicate()
5859
rc = p.wait()
59-
if rc != 0:
60+
if p.returncode != 0:
6061
raise BadRCError("Bad rc (%s) for cmd '%s': %s" % (
61-
rc, cmd, p.stderr.read() + p.stdout.read()))
62-
return p.stdout.read()
62+
rc, cmd, stderr + stdout))
63+
return stdout
6364

6465

6566
def create_scratch_dir():

0 commit comments

Comments
 (0)