diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-12-12 06:13:31 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2020-12-12 06:17:59 -0800 |
commit | 0938bdb2a819bd4bc102ab44aecb075823924d6d (patch) | |
tree | 42607573ed99944afacccaf63ee50c17e6cf61ce /sphinx/setup_command.py | |
parent | 8faa8ba7ab7efbbe8c47558df6996d92bd3bfb8d (diff) | |
download | sphinx-git-0938bdb2a819bd4bc102ab44aecb075823924d6d.tar.gz |
Drop outdated workaround for distutils' Command._ensure_stringlike()
The issue applied to Python 2 only. The current override is identical to
the CPython implementation:
https://github.com/python/cpython/blob/4b8cdfcb22fbeaab9d954cb693a7fb3362a382b6/Lib/distutils/cmd.py#L207-L215
Diffstat (limited to 'sphinx/setup_command.py')
-rw-r--r-- | sphinx/setup_command.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py index 3422f3d4c..0c32db5dd 100644 --- a/sphinx/setup_command.py +++ b/sphinx/setup_command.py @@ -14,7 +14,7 @@ import os import sys from distutils.cmd import Command -from distutils.errors import DistutilsExecError, DistutilsOptionError +from distutils.errors import DistutilsExecError from io import StringIO from sphinx.application import Sphinx @@ -121,20 +121,6 @@ class BuildDoc(Command): return root return os.curdir - # Overriding distutils' Command._ensure_stringlike which doesn't support - # 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: (str, str, Any) -> Any - val = getattr(self, option) - if val is None: - setattr(self, option, default) - return default - elif not isinstance(val, str): - raise DistutilsOptionError("'%s' must be a %s (got `%s`)" - % (option, what, val)) - return val - def finalize_options(self): # type: () -> None self.ensure_string_list('builder') |