From 5f600aa39d8e82d42b04739406e0c94b63ad0d24 Mon Sep 17 00:00:00 2001 From: dimitry Date: Tue, 11 Dec 2018 17:18:54 +0100 Subject: [PATCH] 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 --- vndk/tools/header-checker/utils/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py index 74b2aec84..88982afd6 100644 --- a/vndk/tools/header-checker/utils/utils.py +++ b/vndk/tools/header-checker/utils/utils.py @@ -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()