Run 2to3-3.4
[mygpo.git] / mygpo / core / json.py
blobfd38fe5942018dd1ce470281617e9d368a776eb2
2 # Tries to import the best JSON module available
5 import sys
8 try:
9 # UltraJSON should be the fastest
10 # get it from
11 # https://github.com/esnme/ultrajson
12 # http://pypi.python.org/pypi/ujson/
13 import ujson as json
14 JSONDecodeError = ValueError
16 except ImportError:
17 print('ujson not found', file=sys.stderr)
19 try:
20 # If SimpleJSON is installed separately, it might be a recent version
21 import simplejson as json
22 JSONDecodeError = json.JSONDecodeError
24 except ImportError:
25 print('simplejson not found', file=sys.stderr)
27 # Otherwise use json from the stdlib
28 from . import json
29 JSONDecodeError = ValueError