Skip to content

Instantly share code, notes, and snippets.

@PyYoshi
Created May 20, 2011 03:37
Show Gist options
  • Save PyYoshi/982298 to your computer and use it in GitHub Desktop.
Save PyYoshi/982298 to your computer and use it in GitHub Desktop.
def import_simplejson():
try:
import simplejson as json
except ImportError:
try:
import json # Python 2.6+
except ImportError:
try:
from django.utils import simplejson as json # Google App Engine
except ImportError:
raise ImportError, "Can't load a json library"
return json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment