summaryrefslogtreecommitdiff
path: root/sphinx/util/pycompat.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-15 03:14:11 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-15 23:57:43 +0900
commit6bc357140dbb074eb0d590c1226009f83f97862e (patch)
treea7c8d2087ee1f50dadb5ca78343ac10c6959b740 /sphinx/util/pycompat.py
parent0031c9b4822ae9684888ae90bc70d6ceb3313581 (diff)
downloadsphinx-git-6bc357140dbb074eb0d590c1226009f83f97862e.tar.gz
Replace all "unicode" type by "str"
Diffstat (limited to 'sphinx/util/pycompat.py')
-rw-r--r--sphinx/util/pycompat.py7
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()