From 6a3f4472cc5f3e6f2318e47527ca77bca884c982 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 2 Oct 2024 11:27:02 +0100 Subject: [PATCH] Add a comment explaining why we do this in `create` --- sygnal/gcmpushkin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sygnal/gcmpushkin.py b/sygnal/gcmpushkin.py index 7fed2993..b454da06 100644 --- a/sygnal/gcmpushkin.py +++ b/sygnal/gcmpushkin.py @@ -239,6 +239,9 @@ async def create( # `ClientSession` can't directly take the proxy URL, so we need to # set the usual env var and use `trust_env=True` os.environ["HTTPS_PROXY"] = proxy_url + + # ClientSession must be instantiated by an async function, hence we do this + # here instead of `__init__`. session = aiohttp.ClientSession(trust_env=True, auto_decompress=False) cls.google_auth_request = google.auth.transport._aiohttp_requests.Request(