2 # Tries to import the best JSON module available
9 # UltraJSON should be the fastest
11 # https://github.com/esnme/ultrajson
12 # http://pypi.python.org/pypi/ujson/
14 JSONDecodeError
= ValueError
17 print >> sys
.stderr
, 'ujson not found'
20 # If SimpleJSON is installed separately, it might be a recent version
21 import simplejson
as json
22 JSONDecodeError
= json
.JSONDecodeError
25 print >> sys
.stderr
, 'simplejson not found'
27 # Otherwise use json from the stdlib
29 JSONDecodeError
= ValueError