Skip to content

Commit

Permalink
Update json utils. (celery#804)
Browse files Browse the repository at this point in the history
Some environments bundle versions of simplejson that do not have
JSONDecodeError. Handle ImportErrors in these cases.
  • Loading branch information
AAorris authored and Omer Katz committed Oct 1, 2017
1 parent 572a4c0 commit d782a0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kombu/utils/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ class DjangoPromise(object): # noqa

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
_json_extra_kwargs = {} # noqa

class _DecodeError(Exception): # noqa
pass
else:
from simplejson.decoder import JSONDecodeError as _DecodeError

IS_PY3 = sys.version_info[0] == 3

Expand Down

0 comments on commit d782a0f

Please sign in to comment.