From 5a10e0fe4bd6ced3d7296015d65a56885b658cc7 Mon Sep 17 00:00:00 2001 From: evan Date: Mon, 28 Jan 2013 10:51:41 -0800 Subject: [PATCH 1/2] prefer simplejson when available --- riak/client/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/riak/client/__init__.py b/riak/client/__init__.py index 7f5ce4fe..9425bdba 100644 --- a/riak/client/__init__.py +++ b/riak/client/__init__.py @@ -19,7 +19,11 @@ under the License. """ -import json +try: + import simplejson as json +except ImportError: + import json + import random from weakref import WeakValueDictionary from riak.client.operations import RiakClientOperations From 167c4da1769cf4343eb8f9acfbd1fa5d457f58e8 Mon Sep 17 00:00:00 2001 From: evan Date: Mon, 28 Jan 2013 12:56:57 -0800 Subject: [PATCH 2/2] also update transport imports --- riak/tests/test_kv.py | 5 ++++- riak/transports/http/transport.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index 65862410..6e4981f4 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -2,7 +2,10 @@ import os import cPickle import copy -import json +try: + import simplejson as json +except ImportError: + import json class NotJsonSerializable(object): diff --git a/riak/transports/http/transport.py b/riak/transports/http/transport.py index 9d8269d8..f95b7760 100644 --- a/riak/transports/http/transport.py +++ b/riak/transports/http/transport.py @@ -19,7 +19,11 @@ under the License. """ -import json +try: + import simplejson as json +except ImportError: + import json + import urllib import re import csv