diff --git a/modflow_devtools/download.py b/modflow_devtools/download.py index 4c2b67e..475bc06 100644 --- a/modflow_devtools/download.py +++ b/modflow_devtools/download.py @@ -156,8 +156,8 @@ def get_release(repo, tag="latest", retries=3, verbose=False) -> dict: try: with urllib.request.urlopen(request, timeout=10) as resp: result = resp.read() - remaining = int(resp.headers["x-ratelimit-remaining"]) - if remaining <= 10: + remaining = resp.headers.get("x-ratelimit-remaining", None) + if remaining and int(remaining) <= 10: warn( f"Only {remaining} GitHub API requests remaining " "before rate-limiting"