Update json utils. (#804)

Some environments bundle versions of simplejson that do not have
JSONDecodeError. Handle ImportErrors in these cases.
This commit is contained in:
Aaron Morris 2017-10-01 09:16:17 -07:00 committed by Omer Katz
parent 572a4c02ba
commit d782a0f7cd
1 changed files with 1 additions and 2 deletions

View File

@ -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