summaryrefslogtreecommitdiff
path: root/sphinx/setup_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/setup_command.py')
-rw-r--r--sphinx/setup_command.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py
index 8ff407909..57f6f0c53 100644
--- a/sphinx/setup_command.py
+++ b/sphinx/setup_command.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
sphinx.setup_command
~~~~~~~~~~~~~~~~~~~~
@@ -11,14 +10,12 @@
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
-from __future__ import print_function
import os
import sys
from distutils.cmd import Command
from distutils.errors import DistutilsOptionError, DistutilsExecError
-
-from six import StringIO, string_types
+from io import StringIO
from sphinx.application import Sphinx
from sphinx.cmd.build import handle_exception
@@ -96,14 +93,14 @@ class BuildDoc(Command):
# type: () -> None
self.fresh_env = self.all_files = False
self.pdb = False
- self.source_dir = self.build_dir = None # type: unicode
+ self.source_dir = self.build_dir = None # type: str
self.builder = 'html'
self.warning_is_error = False
self.project = ''
self.version = ''
self.release = ''
self.today = ''
- self.config_dir = None # type: unicode
+ self.config_dir = None # type: str
self.link_index = False
self.copyright = ''
self.verbosity = 0
@@ -111,7 +108,7 @@ class BuildDoc(Command):
self.nitpicky = False
def _guess_source_dir(self):
- # type: () -> unicode
+ # type: () -> str
for guess in ('doc', 'docs'):
if not os.path.isdir(guess):
continue
@@ -124,12 +121,12 @@ class BuildDoc(Command):
# unicode, causing finalize_options to fail if invoked again. Workaround
# for https://bugs.python.org/issue19570
def _ensure_stringlike(self, option, what, default=None):
- # type: (unicode, unicode, Any) -> Any
+ # type: (str, str, Any) -> Any
val = getattr(self, option)
if val is None:
setattr(self, option, default)
return default
- elif not isinstance(val, string_types):
+ elif not isinstance(val, str):
raise DistutilsOptionError("'%s' must be a %s (got `%s`)"
% (option, what, val))
return val
@@ -155,7 +152,7 @@ class BuildDoc(Command):
self.builder_target_dirs = [
(builder, os.path.join(self.build_dir, builder))
- for builder in self.builder] # type: List[Tuple[str, unicode]]
+ for builder in self.builder]
def run(self):
# type: () -> None
@@ -165,7 +162,7 @@ class BuildDoc(Command):
status_stream = StringIO()
else:
status_stream = sys.stdout # type: ignore
- confoverrides = {} # type: Dict[unicode, Any]
+ confoverrides = {} # type: Dict[str, Any]
if self.project:
confoverrides['project'] = self.project
if self.version: