diff options
Diffstat (limited to 'sphinx/config.py')
-rw-r--r-- | sphinx/config.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/config.py b/sphinx/config.py index 2509e0b1b..e12889c61 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 string_types, text_type, integer_types +from six import text_type, integer_types from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning from sphinx.errors import ConfigError, ExtensionError @@ -183,7 +183,7 @@ class Config: self.setup = config.get('setup', None) # type: Callable if 'extensions' in overrides: - if isinstance(overrides['extensions'], string_types): + if isinstance(overrides['extensions'], str): config['extensions'] = overrides.pop('extensions').split(',') else: config['extensions'] = overrides.pop('extensions') @@ -211,7 +211,7 @@ class Config: def convert_overrides(self, name, value): # type: (unicode, Any) -> Any - if not isinstance(value, string_types): + if not isinstance(value, str): return value else: defvalue = self.values[name][0] @@ -231,7 +231,7 @@ class Config: (value, name)) elif hasattr(defvalue, '__call__'): return value - elif defvalue is not None and not isinstance(defvalue, string_types): + elif defvalue is not None and not isinstance(defvalue, str): raise ValueError(__('cannot override config setting %r with unsupported ' 'type, ignoring') % name) else: @@ -265,7 +265,7 @@ class Config: logger.warning(__('unknown config value %r in override, ignoring'), valname) continue - if isinstance(value, string_types): + if isinstance(value, str): config[valname] = self.convert_overrides(valname, value) else: config[valname] = value @@ -316,7 +316,7 @@ class Config: def filter(self, rebuild): # type: (Union[unicode, List[unicode]]) -> Iterator[ConfigValue] - if isinstance(rebuild, string_types): + if isinstance(rebuild, str): rebuild = [rebuild] return (value for value in self if value.rebuild in rebuild) @@ -383,7 +383,7 @@ def convert_source_suffix(app, config): * new style: a dict which maps from fileext to filetype """ source_suffix = config.source_suffix - if isinstance(source_suffix, string_types): + if isinstance(source_suffix, str): # if str, considers as default filetype (None) # # The default filetype is determined on later step. |