From 4337a5cccf3567aac478f3916b9af9cbf5a9abf1 Mon Sep 17 00:00:00 2001 From: xuezhou_yan Date: Mon, 15 Apr 2024 15:40:26 +0800 Subject: [PATCH] =?UTF-8?q?issue:#I9GQY7=20=E9=80=9A=E7=94=A8=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=EF=BC=9A=E7=A6=81=E6=AD=A2=E4=BD=BF=E7=94=A8subproces?= =?UTF-8?q?s=E6=A8=A1=E5=9D=97=E4=B8=AD=E7=9A=84shell=3DTrue=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuezhou_yan --- tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py index 1cb6557..c2fa6ee 100755 --- a/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py +++ b/tools/deps_guard/elf_file_mgr/hdi/hdi_parser.py @@ -27,7 +27,10 @@ class HdiParser(object): hdi_tool = os.path.join(product_out_path, "obj/drivers/hdf_core/framework/tools/hc-gen/hc-gen") hcs_file = os.path.join(product_out_path, "packages/phone/vendor/etc/hdfconfig/hdf_default.hcb") out_file = os.path.join(product_out_path, "device_info.hcs") - subprocess.Popen('%s -d "%s" -o "%s"' % (hdi_tool, hcs_file, out_file), shell=True).wait() + if os.path.exists(hcs_file) and os.path.exists(hdi_tool): + subprocess.Popen([hdi_tool, "-d", hcs_file, "-o", out_file]).wait() + else: + print("{} or {} not exist".format(hcs_file, hdi_tool)) try: with open(out_file) as f: lines = f.readlines() -- Gitee