diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-11-22 22:59:02 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-22 22:59:02 +0900 |
commit | 318cfadfe0a3aa242ad250f6e3a2af8f8791cb5b (patch) | |
tree | 319a68f1fcbbecc2334496adfdf33f4838c3da86 /sphinx/config.py | |
parent | aef14afef937fc87fadc455f5f549e7254733147 (diff) | |
parent | b8631079bfac00c7823b25990105b85a180208b4 (diff) | |
download | sphinx-git-318cfadfe0a3aa242ad250f6e3a2af8f8791cb5b.tar.gz |
Merge pull request #5653 from jdufresne/string_types
Replace six.string_types with native str
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. |