From f9a341832a585e90246873a709cffb4f9ce4ee4b Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Mon, 22 Jan 2024 02:43:00 +0000 Subject: [PATCH] update legacy/python-packager.py. Signed-off-by: Caohongtao --- legacy/python-packager.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/legacy/python-packager.py b/legacy/python-packager.py index ce131ebf..6c86d320 100755 --- a/legacy/python-packager.py +++ b/legacy/python-packager.py @@ -57,7 +57,7 @@ def get_license(j): for k in j["info"]["classifiers"]: if k.startswith("License"): ks = k.split("::") - return ks[2].strip() + return ks[-1].strip() return "" @@ -105,11 +105,13 @@ def get_requires(j): return all requires no matter if extra is required. """ rs = j["info"]["requires_dist"] + mod = None if rs is None: return for r in rs: idx = r.find(";") - mod = transform_module_name(r[:idx]) + if idx != -1: + mod = transform_module_name(r[:idx]) print("Requires:\t" + mod) @@ -223,7 +225,7 @@ def download_source(j, tgtpath): """ download source file from url, and save it to target path """ - if (os.path.exists(tgtpath) == False): + if not os.path.exists(tgtpath): print("download path %s does not exist\n", tgtpath) return False s_url = get_source_url(j) -- Gitee