Skip to content

Commit

Permalink
fixed: HTTPError with a 403 status code message
Browse files Browse the repository at this point in the history
  • Loading branch information
axif0 committed Nov 7, 2024
1 parent f7d4832 commit efb2f0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/scribe_data/check/check_pyicu.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_python_version_and_architecture():

def fetch_wheel_releases():
"""
Fetch the release data for PyICU from GitHub.
Fetch the release data for PyICU from GitHub with error handling for rate limits.
Returns
-------
Expand All @@ -69,6 +69,9 @@ def fetch_wheel_releases():
"""
url = "https://api.github.com/repos/cgohlke/pyicu-build/releases"
response = requests.get(url)
if response.status_code == 403 and "rate limit exceeded" in response.text.lower():
print("GitHub API rate limit exceeded. Please try again later.")
return [], 0.0 # Return empty list and zero size when rate limit is hit
response.raise_for_status() # raise an error for bad responses

available_wheels = []
Expand Down

0 comments on commit efb2f0b

Please sign in to comment.