Skip to content

Commit 24540e3

Browse files
committed
Initialize JsonDecodeError before initializing IOError
That way we get the formated error message
1 parent 620ed4f commit 24540e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

requests/exceptions.py

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class InvalidJSONError(RequestException):
3333

3434
class JSONDecodeError(InvalidJSONError, CompatJSONDecodeError):
3535
"""Couldn't decode the text into json"""
36+
def __init__(self, *args, **kwargs):
37+
CompatJSONDecodeError.__init__(self, *args)
38+
InvalidJSONError.__init__(self, *self.args, **kwargs)
3639

3740

3841
class HTTPError(RequestException):

0 commit comments

Comments
 (0)