fix for issue No time zone found with key UTC

This commit is contained in:
LeonOstrez
2024-07-08 09:00:38 +01:00
parent cc64d9fe1f
commit 2984b3fb45

View File

@@ -116,7 +116,11 @@ class AnthropicClient(BaseLLMClient):
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