From ff944ade6950fcb01964f9426dd6b845378a6d59 Mon Sep 17 00:00:00 2001 From: Ben Campbell Date: Tue, 23 Nov 2021 17:42:40 +0000 Subject: [PATCH] Use reason_phrase https://www.python-httpx.org/api/ --- custom_components/nicehash/nicehash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/nicehash/nicehash.py b/custom_components/nicehash/nicehash.py index 501a3b9..e5544b5 100644 --- a/custom_components/nicehash/nicehash.py +++ b/custom_components/nicehash/nicehash.py @@ -125,7 +125,7 @@ class NiceHashPublicClient: if response.status_code == 200: return response.json() else: - err_messages = [str(response.status_code), response.reason] + err_messages = [str(response.status_code), response.reason_phrase] if response.content: err_messages.append(str(response.content)) raise Exception(": ".join(err_messages)) @@ -190,7 +190,7 @@ class NiceHashPrivateClient: if response.status_code == 200: return response.json() else: - err_messages = [str(response.status_code), response.reason] + err_messages = [str(response.status_code), response.reason_phrase] if response.content: err_messages.append(str(response.content)) raise Exception(": ".join(err_messages))