diff options
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r-- | sphinx/util/pycompat.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index c31044c4e..4190f44ed 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -22,7 +22,6 @@ from sphinx.util import logging if False: # For type annotation from typing import Any, Callable, Generator # NOQA - from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) @@ -44,14 +43,14 @@ sys_encoding = sys.getdefaultencoding() # terminal_safe(): safely encode a string for printing to the terminal def terminal_safe(s): - # type: (unicode) -> unicode + # type: (str) -> str return s.encode('ascii', 'backslashreplace').decode('ascii') # convert_with_2to3(): # support for running 2to3 over config files def convert_with_2to3(filepath): - # type: (unicode) -> unicode + # type: (str) -> str from lib2to3.refactor import RefactoringTool, get_fixers_from_package from lib2to3.pgen2.parse import ParseError fixers = get_fixers_from_package('lib2to3.fixes') @@ -76,7 +75,7 @@ class UnicodeMixin: def execfile_(filepath, _globals, open=open): - # type: (unicode, Any, Callable) -> None + # type: (str, Any, Callable) -> None from sphinx.util.osutil import fs_encoding with open(filepath, 'rb') as f: source = f.read() |