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/jsdump.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/jsdump.py')
-rw-r--r-- | sphinx/util/jsdump.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index 39ed3ea6b..52522f255 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -12,12 +12,9 @@ import re -from six import integer_types - if False: # For type annotation from typing import Any, Dict, IO, List, Match, Union # NOQA - from sphinx.util.typing import unicode # NOQA _str_re = re.compile(r'"(\\\\|\\"|[^"])*"') _int_re = re.compile(r'\d+') @@ -42,7 +39,7 @@ ESCAPED = re.compile(r'\\u.{4}|\\.') def encode_string(s): # type: (str) -> str def replace(match): - # type: (Match) -> unicode + # type: (Match) -> str s = match.group(0) try: return ESCAPE_DICT[s] @@ -95,7 +92,7 @@ def dumps(obj, key=False): return 'null' elif obj is True or obj is False: return obj and 'true' or 'false' - elif isinstance(obj, integer_types + (float,)): # type: ignore + elif isinstance(obj, (int, float)): return str(obj) elif isinstance(obj, dict): return '{%s}' % ','.join(sorted('%s:%s' % ( |