diff --git a/async_upnp_client/aiohttp.py b/async_upnp_client/aiohttp.py index 16b30b4..21204cf 100644 --- a/async_upnp_client/aiohttp.py +++ b/async_upnp_client/aiohttp.py @@ -14,6 +14,7 @@ ClientError, ClientResponseError, ClientSession, + ClientTimeout, ) from async_upnp_client.client import UpnpRequester @@ -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( @@ -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( diff --git a/changes/241.bugfix b/changes/241.bugfix new file mode 100644 index 0000000..1022fc2 --- /dev/null +++ b/changes/241.bugfix @@ -0,0 +1 @@ +Argument `timeout` of method `aiohttp.ClientSession.request()` has to be of type `ClientTimeout`.