Merge pull request #5778 from tk0miya/refactor_six.integer_types

refactor: Replace six.integer_types by int
This commit is contained in:
Takeshi KOMIYA 2018-12-15 20:23:54 +09:00 committed by GitHub
commit cf5b3b61e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -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:

View File

@ -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' % (