From d782a0f7cdc46515301b38e65d255de5ae55e9c2 Mon Sep 17 00:00:00 2001 From: Aaron Morris Date: Sun, 1 Oct 2017 09:16:17 -0700 Subject: [PATCH] Update json utils. (#804) Some environments bundle versions of simplejson that do not have JSONDecodeError. Handle ImportErrors in these cases. --- kombu/utils/json.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kombu/utils/json.py b/kombu/utils/json.py index d824d0ef..3f9f194f 100644 --- a/kombu/utils/json.py +++ b/kombu/utils/json.py @@ -18,6 +18,7 @@ except ImportError: # pragma: no cover try: import simplejson as json + from simplejson.decoder import JSONDecodeError as _DecodeError _json_extra_kwargs = {'use_decimal': False} except ImportError: # pragma: no cover import json # noqa @@ -25,8 +26,6 @@ except ImportError: # pragma: no cover class _DecodeError(Exception): # noqa pass -else: - from simplejson.decoder import JSONDecodeError as _DecodeError IS_PY3 = sys.version_info[0] == 3