-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
While requests.exceptions.JSONDecodeError
was added in 032e6ee in types-requests, that covers only one of the two exposed instances. It was also imported into the top level of requests (psf/requests@db575ee, requests/__init__.py
), which is not reflected in the stubs here. Using requests.JSONDecodeError
in code will cause mypy to complain:
error: Module has no attribute "JSONDecodeError" [attr-defined]
while code using this definition works fine. Changing that line to use requests.exceptions.JSONDecodeError
makes the mypy error go away, while not changing anything in the execution except that the line itself is longer.
It looks like it should be imported between these two lines:
typeshed/stubs/requests/requests/__init__.pyi
Lines 18 to 19 in 749d3db
HTTPError as HTTPError, | |
ReadTimeout as ReadTimeout, |