From f79d1ef42f646a1835eda6b1a50c54e7afe56784 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 18 Mar 2021 13:19:28 +0100 Subject: [PATCH] Also update requests.models.Response --- requests/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/requests/models.py b/requests/models.py index ec2edc20..34b672c2 100644 --- a/requests/models.py +++ b/requests/models.py @@ -877,7 +877,12 @@ class Response(object): r"""Returns the json-encoded content of a response, if any. :param \*\*kwargs: Optional arguments that ``json.loads`` takes. - :raises ValueError: If the response body does not contain valid json. + :raises simplejson.JSONDecodeError: If the response body does not + contain valid json and simplejson is installed. + :raises json.JSONDecodeError: If the response body does not contain + valid json and simplejson is not installed on Python 3. + :raises ValueError: If the response body does not contain valid + json and simplejson is not installed on Python 2. """ if not self.encoding and self.content and len(self.content) > 3: