From 3daeae324b03335c75e3aaa5ab525d5172a72153 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 4 Mar 2021 13:42:00 -0400 Subject: [PATCH] Fix homeserver list for aiohttp <3.7.0 --- src/backend/backend.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backend/backend.py b/src/backend/backend.py index e0ec282c..d8e0e1d6 100644 --- a/src/backend/backend.py +++ b/src/backend/backend.py @@ -544,10 +544,14 @@ class Backend: client = nio.AsyncClient(homeserver="", proxy=proxy) 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, - timeout = type(client.client_session.timeout)(total=20), - connector = client.client_session.connector, + timeout = type(timeout)(total=20), + connector = session.connector, ) api_list = "https://publiclist.anchel.nl/publiclist.json"