-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatibility issues with JSONDecodeError
`requests` is somewhat inconsistent with how it raises this exception. (psf/requests#5794) Depending on the environment, the following can happen during `response.json`: - Python2 and no `simplejson`, a `ValueError` will be raised - Python2 and `simplejson`, a `simplejson.JSONDecodeError` will be raised - Python3 and no `simplejson`, a `json.JSONDecodeError` will be raised - Python3 and `simplejson`, a `simplejson.JSONDecodeError` will be raised The following wil make sure that catching `transifex.api.jsonapi.compat.JSONDecodeError` in a `try: response.json()` block will always work
- Loading branch information
Konstantinos Bairaktaris
committed
Sep 9, 2021
1 parent
ec29fd1
commit e425373
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters