Skip to content

Commit

Permalink
fix for issue No time zone found with key UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonOstrez committed Jul 8, 2024
1 parent cc64d9f commit 2984b3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/llm/anthropic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def rate_limit_sleep(self, err: RateLimitError) -> Optional[datetime.timedelta]:
except ValueError:
return datetime.timedelta(seconds=5)

now = datetime.datetime.now(tz=zoneinfo.ZoneInfo("UTC"))
try:
now = datetime.datetime.now(tz=zoneinfo.ZoneInfo("UTC"))
except zoneinfo.ZoneInfoNotFoundError:
now = datetime.datetime.now(tz=datetime.timezone.utc)

return reset_time - now


Expand Down

0 comments on commit 2984b3f

Please sign in to comment.