From b911a39a813d8f7225ccd870e20ae88a0310ec15 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 15 Dec 2018 20:05:33 +0900 Subject: [PATCH] refactor: Replace six.integer_types by int --- sphinx/config.py | 4 ++-- sphinx/util/jsdump.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sphinx/config.py b/sphinx/config.py index 017307cb3..b56df167d 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -17,7 +17,7 @@ from collections import OrderedDict from os import path, getenv from typing import Any, NamedTuple, Union -from six import text_type, integer_types +from six import text_type from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning from sphinx.errors import ConfigError, ExtensionError @@ -224,7 +224,7 @@ class Config: (name, name + '.key=value')) elif isinstance(defvalue, list): return value.split(',') - elif isinstance(defvalue, integer_types): + elif isinstance(defvalue, int): try: return int(value) except ValueError: diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index 39ed3ea6b..6502f2408 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -12,8 +12,6 @@ import re -from six import integer_types - if False: # For type annotation from typing import Any, Dict, IO, List, Match, Union # NOQA @@ -95,7 +93,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' % (