From 186d16f5862689b5283ef805909a0e0f90f74c88 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Sat, 30 Dec 2023 10:36:53 +0800 Subject: [PATCH] ci: Fix script run fail in some case Signed-off-by: Huaqi Fang <578567190@qq.com> --- .github/prepare_tools.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/prepare_tools.py b/.github/prepare_tools.py index e2ad47e..d6eff2b 100644 --- a/.github/prepare_tools.py +++ b/.github/prepare_tools.py @@ -167,7 +167,7 @@ def setup_gd_openocd(toolsdir, gd_openocd_uri, system_value, nsideloc, reuse): else: org_folder = gd_openocd_uri if os.path.isdir(os.path.join(org_folder, "scripts")) == False: - print("This may not be a valid openocd package!" % (org_folder)) + print("This %s may not be a valid openocd package!" % (org_folder)) sys.exit(1) # Rename the old openocd folder to gd_openocd if os.path.isdir(destination_folder) == False: @@ -190,13 +190,12 @@ def setup_gd_openocd(toolsdir, gd_openocd_uri, system_value, nsideloc, reuse): REUSE_ARCHIVE = True def is_valid_url(url): - if not url: - return False try: - result = urlparse(url) - return True + if url and urlparse(url).netloc != "": + return True except: - return False + pass + return False def prepare_tools(prebltloc=PREBLT_TOOLS, nside=None, gdocd=None): ostype = platform.system()