From 99440f9d596668724690d9091e0a5def1d7f1d6d Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 1 Jul 2015 06:14:01 +1000 Subject: [PATCH] Wait for command in worlddump Wait for the command to complete and catch errors when running commands. Change-Id: I2c93b3bdd930ed8564e33bd2d45fe4e3f08f03f5 --- tools/worlddump.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/worlddump.py b/tools/worlddump.py index 628a69f7e5..0a9f810877 100755 --- a/tools/worlddump.py +++ b/tools/worlddump.py @@ -21,9 +21,9 @@ import datetime import fnmatch import os import os.path +import subprocess import sys -from subprocess import Popen def get_options(): parser = argparse.ArgumentParser( @@ -47,7 +47,10 @@ def _dump_cmd(cmd): print cmd print "-" * len(cmd) print - Popen(cmd, shell=True) + try: + subprocess.check_call(cmd, shell=True) + except subprocess.CalledProcessError: + print "*** Failed to run: %s" % cmd def _header(name):