From ebc4d692fb7ca13fcbdfb53948e6220583d6e1a6 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Fri, 19 Apr 2024 08:54:08 +0800 Subject: [PATCH] =?UTF-8?q?(#324)=20=E6=94=AF=E6=8C=81=E5=A4=9A=E7=A7=8D?= =?UTF-8?q?=20api::exceptions::JSONDecodeError=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/exceptions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/exceptions.py b/api/exceptions.py index d66e38c7..473c197d 100644 --- a/api/exceptions.py +++ b/api/exceptions.py @@ -1,6 +1,9 @@ from loguru import logger -# from requests.exceptions import JSONDecodeError -from json import JSONDecodeError + +try: + from requests.exceptions import JSONDecodeError +except: # noqa: E722 + from json import JSONDecodeError class BaseException(Exception): def __init__(self, _msg: str = None):