summaryrefslogtreecommitdiff
path: root/sphinx/util/jsdump.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-11-20 19:50:08 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2018-11-21 06:47:15 -0800
commitb8631079bfac00c7823b25990105b85a180208b4 (patch)
treec579987fbf4d5cee55ba32b9f4166af0365486e1 /sphinx/util/jsdump.py
parentc4df9b5de2f57387a23ec5b28f74b5e760040dd6 (diff)
downloadsphinx-git-b8631079bfac00c7823b25990105b85a180208b4.tar.gz
Replace six.string_types with native str
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r--sphinx/util/jsdump.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py
index acdeb3083..e7b1146a2 100644
--- a/sphinx/util/jsdump.py
+++ b/sphinx/util/jsdump.py
@@ -12,7 +12,7 @@
import re
-from six import integer_types, string_types
+from six import integer_types
if False:
# For type annotation
@@ -84,7 +84,7 @@ double in super""".split())
def dumps(obj, key=False):
# type: (Any, bool) -> str
if key:
- if not isinstance(obj, string_types):
+ if not isinstance(obj, str):
obj = str(obj)
if _nameonly_re.match(obj) and obj not in reswords:
return obj # return it as a bare word
@@ -105,8 +105,8 @@ def dumps(obj, key=False):
return '[%s]' % ','.join(sorted(dumps(x) for x in obj))
elif isinstance(obj, (tuple, list)):
return '[%s]' % ','.join(dumps(x) for x in obj)
- elif isinstance(obj, string_types):
- return encode_string(obj) # type: ignore
+ elif isinstance(obj, str):
+ return encode_string(obj)
raise TypeError(type(obj))