diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-16 00:32:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-16 00:32:10 +0900 |
commit | c70e65fc6cd04d02df4f7911025f534dbd27cc20 (patch) | |
tree | 1e8614ac5516dace99ef1df4d203081662c7c2d6 /sphinx/util/jsonimpl.py | |
parent | d6d4406ce987cc8823d1b3a33be3a418bcd2a59d (diff) | |
parent | 79eec90f36f5a74e24cfd6740126396fd6567e07 (diff) | |
download | sphinx-git-c70e65fc6cd04d02df4f7911025f534dbd27cc20.tar.gz |
Merge branch 'master' into 5770_doctest_refers_highlight_language
Diffstat (limited to 'sphinx/util/jsonimpl.py')
-rw-r--r-- | sphinx/util/jsonimpl.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py index 557bc122f..ba47cf29f 100644 --- a/sphinx/util/jsonimpl.py +++ b/sphinx/util/jsonimpl.py @@ -10,20 +10,19 @@ """ import json +from collections import UserString from six import text_type -from six.moves import UserString if False: # For type annotation from typing import Any, IO # NOQA - from sphinx.util.typing import unicode # NOQA class SphinxJSONEncoder(json.JSONEncoder): """JSONEncoder subclass that forces translation proxies.""" def default(self, obj): - # type: (Any) -> unicode + # type: (Any) -> str if isinstance(obj, UserString): return text_type(obj) return super(SphinxJSONEncoder, self).default(obj) @@ -36,7 +35,7 @@ def dump(obj, fp, *args, **kwds): def dumps(obj, *args, **kwds): - # type: (Any, Any, Any) -> unicode + # type: (Any, Any, Any) -> str kwds['cls'] = SphinxJSONEncoder return json.dumps(obj, *args, **kwds) |