diff options
author | nikolas <nikolas@gnu.org> | 2021-08-13 14:52:05 -0400 |
---|---|---|
committer | Asif Saif Uddin <auvipy@gmail.com> | 2021-08-14 12:27:06 +0600 |
commit | 78f9b60e500acc285e678652f50da85db16b6430 (patch) | |
tree | 10bf64fa0d1bd7612ab357a60a839cc8d8ffbcdb | |
parent | 8b3498416f4fca3463799c48abb60dc5fb285e0f (diff) | |
download | kombu-78f9b60e500acc285e678652f50da85db16b6430.tar.gz |
Use Python's built-in json module by default, instead of simplejson
Only use simplejson if it's absolutely necessary - Python's built-in json module is better if it's available.
-rw-r--r-- | kombu/utils/json.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kombu/utils/json.py b/kombu/utils/json.py index 0cdf6376..cedaa793 100644 --- a/kombu/utils/json.py +++ b/kombu/utils/json.py @@ -12,18 +12,18 @@ except ImportError: # pragma: no cover """Dummy object.""" try: + import json + _json_extra_kwargs = {} + + class _DecodeError(Exception): + pass +except ImportError: # pragma: no cover import simplejson as json from simplejson.decoder import JSONDecodeError as _DecodeError _json_extra_kwargs = { 'use_decimal': False, 'namedtuple_as_object': False, } -except ImportError: # pragma: no cover - import json - _json_extra_kwargs = {} - - class _DecodeError(Exception): - pass _encoder_cls = type(json._default_encoder) |