Skip to content

Commit

Permalink
utils.py: ujson now defines a JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Apr 24, 2022
1 parent 2456376 commit dfcc5e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internetarchive/utils.py
Expand Up @@ -37,11 +37,10 @@
# Make preferred JSON package available via `from internetarchive.utils import json`
try:
import ujson as json
# ujson lacks a JSONDecodeError: https://github.com/ultrajson/ultrajson/issues/497
JSONDecodeError = ValueError
except ImportError:
import json
JSONDecodeError = json.JSONDecodeError
import json # type: ignore

JSONDecodeError = json.JSONDecodeError


def deep_update(d, u):
Expand Down

0 comments on commit dfcc5e0

Please sign in to comment.