[Tests] for coverage omits
[mygpo.git] / mygpo / core / json.py
blob590fbc4716712117553c660444795dfb41f2ad37
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 import json
29 JSONDecodeError = ValueError