提交 3b0a6892 编写于 作者: Z zengweifeng

fix function check_pypi error

上级 94981526
......@@ -188,12 +188,11 @@ def check_pypi(info):
}
url = urljoin("https://pypi.org/pypi/", info["src_repo"] + "/json")
resp = requests.get(url, headers=headers)
resp = resp.text
result_json = json.loads(resp)
if result_json != {}:
tags.append(result_json["info"]["version"])
else:
data = resp.json()
for key in data["releases"].keys():
tags.append(key)
if len(tags) == 0:
eprint("{repo} > No Response or JSON parse failed".format(repo=info["src_repo"]))
sys.exit(1)
return tags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册