Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch to ujson

  • Loading branch information...
commit bcc229a6c504b036130de750b2b78b3e5d902e1f 1 parent 5438581
Colin Howe colinhowe authored
2  REQUIREMENTS
View
@@ -1,2 +1,2 @@
bunch>=1.0.1
-simplejson>=2.4.0
+ujson>=1.19
9 src/facegraph/api.py
View
@@ -1,7 +1,6 @@
import socket
-import simplejson
+import ujson as json
from urllib import urlencode, unquote
-from simplejson.decoder import JSONDecodeError
FB_READ_TIMEOUT = 180
@@ -112,8 +111,8 @@ def __call__(self, _retries=None, *args, **kwargs):
def __process_response(self, response, params=None):
try:
- data = simplejson.loads(response)
- except JSONDecodeError:
+ data = json.loads(response)
+ except ValueError:
data = response
try:
if 'error_code' in data:
@@ -222,7 +221,7 @@ def __fetch(self, url):
response = self.urllib2.urlopen(url, timeout=self.timeout)
except self.urllib2.HTTPError, e:
response = e.fp
- return simplejson.load(response)
+ return json.load(response)
def verify_token(self, tries=1):
url = "https://graph.facebook.com/me?access_token=%s" % self.access_token
2  src/facegraph/fql.py
View
@@ -3,7 +3,7 @@
import urllib2
import bunch
-import simplejson as json
+import ujson as json
from graph import GraphException
from url_operations import add_path, update_query_params
3  src/facegraph/graph.py
View
@@ -11,7 +11,7 @@
add_query_params, update_query_params, get_path)
import bunch
-import simplejson as json
+import ujson as json
from functools import partial
p = "^\(#(\d+)\)"
@@ -399,4 +399,3 @@ def __str__(self):
if self.code:
s += ", (%s)" % self.code
return s
-
Please sign in to comment.
Something went wrong with that request. Please try again.