diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-14 21:14:11 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 17:57:43 +0300 |
commit | 6bc357140dbb074eb0d590c1226009f83f97862e (patch) | |
tree | a7c8d2087ee1f50dadb5ca78343ac10c6959b740 /sphinx/addnodes.py | |
parent | 0031c9b4822ae9684888ae90bc70d6ceb3313581 (diff) |
Replace all "unicode" type by "str"
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r-- | sphinx/addnodes.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 4b330b8ec..7c8f2c9d0 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -19,7 +19,6 @@ if False: # For type annotation from typing import Any, Dict, List, Sequence # NOQA from sphinx.application import Sphinx # NOQA - from sphinx.util.typing import unicode # NOQA class translatable(nodes.Node): @@ -42,12 +41,12 @@ class translatable(nodes.Node): raise NotImplementedError def apply_translated_message(self, original_message, translated_message): - # type: (unicode, unicode) -> None + # type: (str, str) -> None """Apply translated message.""" raise NotImplementedError def extract_original_messages(self): - # type: () -> Sequence[unicode] + # type: () -> Sequence[str] """Extract translation messages. :returns: list of extracted messages or messages generator @@ -69,12 +68,12 @@ class toctree(nodes.General, nodes.Element, translatable): self['rawcaption'] = self['caption'] def apply_translated_message(self, original_message, translated_message): - # type: (unicode, unicode) -> None + # type: (str, str) -> None if self.get('rawcaption') == original_message: self['caption'] = translated_message def extract_original_messages(self): - # type: () -> List[unicode] + # type: () -> List[str] if 'rawcaption' in self: return [self['rawcaption']] else: @@ -128,7 +127,7 @@ class desc_type(nodes.Part, nodes.Inline, nodes.FixedTextElement): class desc_returns(desc_type): """Node for a "returns" annotation (a la -> in Python).""" def astext(self): - # type: () -> unicode + # type: () -> str return ' -> ' + super(desc_returns, self).astext() @@ -150,7 +149,7 @@ class desc_optional(nodes.Part, nodes.Inline, nodes.FixedTextElement): child_text_separator = ', ' def astext(self): - # type: () -> unicode + # type: () -> str return '[' + super(desc_optional, self).astext() + ']' @@ -363,7 +362,7 @@ class manpage(nodes.Inline, nodes.FixedTextElement): def setup(app): - # type: (Sphinx) -> Dict[unicode, Any] + # type: (Sphinx) -> Dict[str, Any] app.add_node(toctree) app.add_node(desc) app.add_node(desc_signature) |