From 2b6bccc51a430cc46db3f8269d93b0ce56fc2e7f Mon Sep 17 00:00:00 2001 From: risemeup1 <62429225+risemeup1@users.noreply.github.com> Date: Mon, 31 Oct 2022 09:49:56 +0800 Subject: [PATCH] Fix the problem of printing log (#47474) --- tools/handle_h_cu_file.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/handle_h_cu_file.py b/tools/handle_h_cu_file.py index 84fba9f2820..7cd29b39aa7 100644 --- a/tools/handle_h_cu_file.py +++ b/tools/handle_h_cu_file.py @@ -90,10 +90,14 @@ def get_h_cu_file(file_path): dir_path = file_path[1] filename = file_path[2] ut = filename.replace('^', '').replace('$', '').replace('.log', '') - os.system( - "cat %s/%s | grep 'precise test map fileeee:'| uniq >> %s/build/ut_map/%s/related_%s.txt" - % (dir_path, filename, rootPath, ut, ut) - ) + ut_path = "%s/build/ut_map/%s" % (rootPath, ut) + if os.path.exists(ut_path): + os.system( + "cat %s/%s | grep 'precise test map fileeee:'| uniq >> %s/build/ut_map/%s/related_%s.txt" + % (dir_path, filename, rootPath, ut, ut) + ) + else: + print("%s has failed,no has direcotory" % ut) def doFun(file_path): -- GitLab