update-python-resources: handle no sdist for package

This commit is contained in:
Rylan Polster 2020-07-31 14:21:44 -04:00
parent dbe8453855
commit b08d1a28ad

View File

@ -35,6 +35,8 @@ module PyPI
end end
sdist = json["urls"].find { |url| url["packagetype"] == "sdist" } sdist = json["urls"].find { |url| url["packagetype"] == "sdist" }
return json["info"]["name"] if sdist.nil?
[json["info"]["name"], sdist["url"], sdist["digests"]["sha256"]] [json["info"]["name"], sdist["url"], sdist["digests"]["sha256"]]
end end