Skip to content

Commit 91733b5

Browse files
committed
A try to fix JSONDecodeError for simplejson
1 parent f9b77b8 commit 91733b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

reportportal_client/core/rp_responses.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"""
2020

2121
import logging
22-
from json import JSONDecodeError
2322
from typing import Any, Optional, Generator, Mapping, Tuple, Union
2423

2524
from aiohttp import ClientResponse
@@ -88,7 +87,7 @@ def json(self) -> Any:
8887
if self.__json is NOT_SET:
8988
try:
9089
self.__json = self._resp.json()
91-
except (JSONDecodeError, TypeError) as exc:
90+
except (ValueError, TypeError) as exc:
9291
logger.error(_get_json_decode_error_message(self._resp), exc_info=exc)
9392
self.__json = None
9493
return self.__json
@@ -156,7 +155,7 @@ async def json(self) -> Any:
156155
if self.__json is NOT_SET:
157156
try:
158157
self.__json = await self._resp.json()
159-
except (JSONDecodeError, TypeError) as exc:
158+
except (ValueError, TypeError) as exc:
160159
logger.error(_get_json_decode_error_message(self._resp), exc_info=exc)
161160
self.__json = None
162161
return self.__json

0 commit comments

Comments
 (0)