From 60c1240849fc6e8c4ea313469bfd4824fd272cb9 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 1 May 2021 09:22:50 -0400 Subject: [PATCH] Fix SyncWebhook exception case causing attribute errors --- discord/webhook/sync.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index eb79022c1..1fd05f3ee 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -156,6 +156,9 @@ class WebhookAdapter: response.status_code, ) response.encoding = 'utf-8' + # Compatibility with aiohttp + response.status = response.status_code # type: ignore + data = response.text or None if data and response.headers['Content-Type'] == 'application/json': data = json.loads(data)