Fix #921 detect if user has json-py installed and add dumps and loads attributes to it

This commit is contained in:
Andrew Resch 2009-05-09 03:18:54 +00:00
parent 5b3528c9d1
commit f12f02fff8
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@ try:
except ImportError: except ImportError:
import simplejson as json import simplejson as json
# Do a little hack here just in case the user has json-py installed since it
# has a different api
if not hasattr(json, "dumps"):
json.dumps = json.write
json.loads = json.read
import pkg_resources import pkg_resources
import xdg, xdg.BaseDirectory import xdg, xdg.BaseDirectory