style(translation): use datetime.UTC alias (ruff UP017)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ behind a reverse proxy). Full API contract: Scribe note #1347.
|
|||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import datetime, timezone
|
from datetime import UTC, datetime
|
||||||
from email.utils import parsedate_to_datetime
|
from email.utils import parsedate_to_datetime
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@@ -53,8 +53,8 @@ def _parse_retry_after(resp) -> float | None:
|
|||||||
if when is None:
|
if when is None:
|
||||||
return None
|
return None
|
||||||
if when.tzinfo is None:
|
if when.tzinfo is None:
|
||||||
when = when.replace(tzinfo=timezone.utc)
|
when = when.replace(tzinfo=UTC)
|
||||||
return max(0.0, (when - datetime.now(timezone.utc)).total_seconds())
|
return max(0.0, (when - datetime.now(UTC)).total_seconds())
|
||||||
|
|
||||||
|
|
||||||
def health(base_url: str, *, timeout: float = 5.0) -> bool:
|
def health(base_url: str, *, timeout: float = 5.0) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user