Skip to content

Commit

Permalink
Error when no urls are found in a pypi release (#71)
Browse files Browse the repository at this point in the history
Adds error handling for when pypi returns no URLs. Fixes Issue #70
  • Loading branch information
cbm755 authored and johannesjh committed Jul 7, 2024
1 parent 4a49a23 commit b3be5e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions req2flatpak.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def get_release(cls, req: Requirement) -> Release:
url = f"https://pypi.org/pypi/{req.package}/{req.version}/json"
json_string = cls._query(url)
json_dict = json.loads(json_string)
if not json_dict["urls"]:
raise RuntimeError(f"Release {req} has no URLs: maybe too old?")
return Release(
package=req.package,
version=req.version,
Expand Down

0 comments on commit b3be5e6

Please sign in to comment.