Permalink
Browse files

More flexible JSON importing

  • Loading branch information...
1 parent 95d831e commit 0754feaeb8e04a08cd412c17a4ce55dbd76389bd @mccutchen committed Mar 4, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 chirp.py
View
11 chirp.py
@@ -41,7 +41,16 @@
import sys
import urllib
-from django.utils import simplejson as json
+try:
+ import json
+except ImportError:
+ try:
+ import simplejson as json
+ except ImportError:
+ try:
+ from django.utils import simplejson
+ except ImportError:
+ raise ImportError, 'Unable to load a json library'
API_HOST = 'api.twitter.com'

0 comments on commit 0754fea

Please sign in to comment.