Tools: build_binaries: raise a CalledProcessError on bad exit code

We've been silently ignoring bad exit codes.  Stop that.
This commit is contained in:
Peter Barker 2018-03-01 15:21:16 +11:00 committed by Peter Barker
parent 4d28fa8e09
commit 3f17ac765e
1 changed files with 10 additions and 3 deletions

View File

@ -68,14 +68,21 @@ class build_binaries(object):
while True:
x = p.stdout.readline()
if len(x) == 0:
if os.waitpid(p.pid, 0):
returncode = os.waitpid(p.pid, 0)
if returncode:
break
# select not available on Windows... probably...
time.sleep(0.1)
continue
time.sleep(0.1)
continue
output += x
x = x.rstrip()
print("%s: %s" % (prefix, x))
(_, status) = returncode
if status != 0:
self.progress("Process failed (%s)" %
str(returncode))
raise subprocess.CalledProcessError(
returncode, cmd_list)
return output
def run_make(self, args):