Skip to content

Commit

Permalink
A try to fix JSONDecodeError for simplejson
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Nov 29, 2024
1 parent f9b77b8 commit 91733b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions reportportal_client/core/rp_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"""

import logging
from json import JSONDecodeError
from typing import Any, Optional, Generator, Mapping, Tuple, Union

from aiohttp import ClientResponse
Expand Down Expand Up @@ -88,7 +87,7 @@ def json(self) -> Any:
if self.__json is NOT_SET:
try:
self.__json = self._resp.json()
except (JSONDecodeError, TypeError) as exc:
except (ValueError, TypeError) as exc:
logger.error(_get_json_decode_error_message(self._resp), exc_info=exc)
self.__json = None
return self.__json
Expand Down Expand Up @@ -156,7 +155,7 @@ async def json(self) -> Any:
if self.__json is NOT_SET:
try:
self.__json = await self._resp.json()
except (JSONDecodeError, TypeError) as exc:
except (ValueError, TypeError) as exc:
logger.error(_get_json_decode_error_message(self._resp), exc_info=exc)
self.__json = None
return self.__json
Expand Down

0 comments on commit 91733b5

Please sign in to comment.