Merge "Slightly improve error handling"

am: a87126ad77

Change-Id: I2a32c1035f28c7ccdc2767a2a499d96a790922a6
This commit is contained in:
dimitry
2018-12-19 09:51:32 -08:00
committed by android-build-merger

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()