From b216d41492ca044822d8e349e1c5718ccaaa449c Mon Sep 17 00:00:00 2001 From: DevilXD Date: Mon, 24 Oct 2022 17:32:58 +0200 Subject: [PATCH] Pre-read the response to avoid getting errors outside of the context manager --- twitch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/twitch.py b/twitch.py index 1fdb211..6ed084a 100644 --- a/twitch.py +++ b/twitch.py @@ -1027,6 +1027,8 @@ class Twitch: logger.debug(f"Response: {response.status}: {response}") if response.status >= 500: self.print(_("error", "site_down").format(seconds=round(delay))) + # pre-read the response to avoid getting errors outside of the context manager + await response.read() yield response return except (aiohttp.ClientConnectionError, asyncio.TimeoutError):