summaryrefslogtreecommitdiff
path: root/sphinx/util/jsonimpl.py
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2014-04-29 19:59:58 +0900
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2014-04-29 19:59:58 +0900
commitc3c879f2c63afbb39ad4d76ecc083cddd41d9946 (patch)
treef329b64577f21b54e54764ea2b2eb36dff149940 /sphinx/util/jsonimpl.py
parent68290a266cea33cf0b60bed425b5e89d1032e7d1 (diff)
downloadsphinx-git-c3c879f2c63afbb39ad4d76ecc083cddd41d9946.tar.gz
use six privided functions/classes to support py2/py3 in one source. refs #1350.
Diffstat (limited to 'sphinx/util/jsonimpl.py')
-rw-r--r--sphinx/util/jsonimpl.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py
index 05a6ec6e2..6682a3765 100644
--- a/sphinx/util/jsonimpl.py
+++ b/sphinx/util/jsonimpl.py
@@ -9,14 +9,15 @@
:license: BSD, see LICENSE for details.
"""
-import UserString
import json
+from six.moves import UserString
+
class SphinxJSONEncoder(json.JSONEncoder):
"""JSONEncoder subclass that forces translation proxies."""
def default(self, obj):
- if isinstance(obj, UserString.UserString):
+ if isinstance(obj, UserString):
return unicode(obj)
return json.JSONEncoder.default(self, obj)