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

fix function check_pypi error

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