Skip to content

Commit

Permalink
Fix for older httpx versions
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Dec 10, 2024
1 parent 9dd0c0a commit 5f59083
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apitally/client/client_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def __init__(
self._set_startup_data_task: Optional[asyncio.Task] = None

def get_http_client(self) -> httpx.AsyncClient:
return httpx.AsyncClient(base_url=self.hub_url, timeout=REQUEST_TIMEOUT, proxy=self.proxy)
if httpx.__version__ >= "0.26.0":
# `proxy` parameter was added in version 0.26.0
return httpx.AsyncClient(base_url=self.hub_url, timeout=REQUEST_TIMEOUT, proxy=self.proxy)
else:
return httpx.AsyncClient(base_url=self.hub_url, timeout=REQUEST_TIMEOUT)

def start_sync_loop(self) -> None:
self._stop_sync_loop = False
Expand Down

0 comments on commit 5f59083

Please sign in to comment.