Slightly improve error handling

Test: ./development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libGLESv1_CM
Test: now fails with error message
Change-Id: Idd9aa84d8da6d4f6016f41438571ac1f0808be7e
This commit is contained in:
dimitry
2018-12-11 17:18:54 +01:00
parent eefa3a7ca4
commit 5f600aa39d

View File

@@ -241,8 +241,12 @@ def get_build_vars_for_product(names, product=None):
cmd += '\"'
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL, cwd=AOSP_DIR, shell=True)
out, _ = proc.communicate()
stderr=subprocess.PIPE, cwd=AOSP_DIR, shell=True)
out, err = proc.communicate()
if proc.returncode != 0:
print ("error: %s" % err.decode('utf-8'), file=sys.stderr)
return None
build_vars = out.decode('utf-8').strip().splitlines()