Skip to content

Commit

Permalink
Argument timeout of method aiohttp.ClientSession.request() has to…
Browse files Browse the repository at this point in the history
… be of type `ClientTimeout` (#241)
  • Loading branch information
StevenLooman authored Aug 30, 2024
1 parent a5e8fc7 commit ed4b11c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions async_upnp_client/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
ClientError,
ClientResponseError,
ClientSession,
ClientTimeout,
)

from async_upnp_client.client import UpnpRequester
Expand Down Expand Up @@ -64,7 +65,7 @@ def __init__(
self, timeout: int = 5, http_headers: Optional[Mapping[str, str]] = None
) -> None:
"""Initialize."""
self._timeout = timeout
self._timeout = ClientTimeout(total=float(timeout))
self._http_headers = http_headers or {}

async def async_http_request(
Expand Down Expand Up @@ -158,7 +159,7 @@ def __init__(
"""Initialize."""
self._session = session
self._with_sleep = with_sleep
self._timeout = timeout
self._timeout = ClientTimeout(total=float(timeout))
self._http_headers = http_headers or {}

async def async_http_request(
Expand Down
1 change: 1 addition & 0 deletions changes/241.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Argument `timeout` of method `aiohttp.ClientSession.request()` has to be of type `ClientTimeout`.

0 comments on commit ed4b11c

Please sign in to comment.