Fix homeserver list for aiohttp <3.7.0

This commit is contained in:
miruka 2021-03-04 13:42:00 -04:00
parent a4f94b6de0
commit 3daeae324b

View File

@ -544,10 +544,14 @@ class Backend:
client = nio.AsyncClient(homeserver="", proxy=proxy) client = nio.AsyncClient(homeserver="", proxy=proxy)
await have_session_be_created(client) await have_session_be_created(client)
session = type(client.client_session)(
session = client.client_session
# aiohttp only has "timeout" in 3.7.0+
timeout = getattr(session, "timeout", session._timeout)
session = type(session)(
raise_for_status = True, raise_for_status = True,
timeout = type(client.client_session.timeout)(total=20), timeout = type(timeout)(total=20),
connector = client.client_session.connector, connector = session.connector,
) )
api_list = "https://publiclist.anchel.nl/publiclist.json" api_list = "https://publiclist.anchel.nl/publiclist.json"