diff options
| author | Takayuki Shimizukawa <shimizukawa+bitbucket@gmail.com> | 2014-05-28 00:08:48 +0900 |
|---|---|---|
| committer | Takayuki Shimizukawa <shimizukawa+bitbucket@gmail.com> | 2014-05-28 00:08:48 +0900 |
| commit | 2bea449254abb21a56f4d7193ece32afb2da82f8 (patch) | |
| tree | 209431e7c8f4ff28f2cbc9e579aeeb570418f41a /sphinx/util/jsonimpl.py | |
| parent | 362225b5cf5642e50990d633eae241721ed640b4 (diff) | |
| parent | 88fe3b0b04f3fff0fce6c9b99d5da73dd5dda880 (diff) | |
| download | sphinx-2bea449254abb21a56f4d7193ece32afb2da82f8.tar.gz | |
Merged in vitaut/sphinx/cpp-variadic (pull request #241)
Add support for variadic templates in C++ domain
Diffstat (limited to 'sphinx/util/jsonimpl.py')
| -rw-r--r-- | sphinx/util/jsonimpl.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py index 05a6ec6e..ac5c54ae 100644 --- a/sphinx/util/jsonimpl.py +++ b/sphinx/util/jsonimpl.py @@ -9,15 +9,17 @@ :license: BSD, see LICENSE for details. """ -import UserString import json +from six import text_type +from six.moves import UserString + class SphinxJSONEncoder(json.JSONEncoder): """JSONEncoder subclass that forces translation proxies.""" def default(self, obj): - if isinstance(obj, UserString.UserString): - return unicode(obj) + if isinstance(obj, UserString): + return text_type(obj) return json.JSONEncoder.default(self, obj) |
