Skip to content
Browse files

load json in a python 2.6 compatible way

  • Loading branch information...
1 parent 82e617d commit 3afc25af81a99c22f4ffb1cefaa7cd6ffd001fa0 @askedrelic committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 libgreader/auth.py
View
9 libgreader/auth.py
@@ -4,7 +4,12 @@
import urllib2
import urlparse
import time
-import simplejson
+
+try:
+ import json
+except:
+ # Python 2.6 support
+ import simplejson as json
try:
import oauth2 as oauth
@@ -287,7 +292,7 @@ def setAccessToken(self):
)
try:
- response = simplejson.loads(urllib2.urlopen(request).read())
+ response = json.loads(urllib2.urlopen(request).read())
except urllib2.HTTPError, e:
raise IOError('Error getting Access Token')

0 comments on commit 3afc25a

Please sign in to comment.
Something went wrong with that request. Please try again.