summaryrefslogtreecommitdiff
path: root/sphinx/util/jsonimpl.py
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa@gmail.com>2014-04-29 23:44:12 +0900
committerTakayuki Shimizukawa <shimizukawa@gmail.com>2014-04-29 23:44:12 +0900
commit00eff0b7f656b5212b6f4d2c567f6828ee81ee82 (patch)
treec2c9028bcde9a51b75743a7b00d298da59e86e03 /sphinx/util/jsonimpl.py
parent91b9d75ac88afc349de4f8629b99c7fbcb3ff841 (diff)
downloadsphinx-git-00eff0b7f656b5212b6f4d2c567f6828ee81ee82.tar.gz
use six privided text_type() to replace with unicode() to support py2/py3 in one source. refs #1350.
Diffstat (limited to 'sphinx/util/jsonimpl.py')
-rw-r--r--sphinx/util/jsonimpl.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py
index 6682a3765..ac5c54aec 100644
--- a/sphinx/util/jsonimpl.py
+++ b/sphinx/util/jsonimpl.py
@@ -11,6 +11,7 @@
import json
+from six import text_type
from six.moves import UserString
@@ -18,7 +19,7 @@ class SphinxJSONEncoder(json.JSONEncoder):
"""JSONEncoder subclass that forces translation proxies."""
def default(self, obj):
if isinstance(obj, UserString):
- return unicode(obj)
+ return text_type(obj)
return json.JSONEncoder.default(self, obj)