Merge branch 'master' into design
[mygpo.git] / mygpo / core / json.py
blobd96186ca6dce9065fb6b2b54f1b55e76310aa3fa
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 >> sys.stderr, 'ujson not found'
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 >> sys.stderr, 'simplejson not found'
27 # Otherwise use json from the stdlib
28 import json
29 JSONDecodeError = ValueError