diff options
Diffstat (limited to 'sphinx/builders/changes.py')
-rw-r--r-- | sphinx/builders/changes.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index 5f1999003..5b934fb3e 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -27,7 +27,6 @@ if False: # For type annotation from typing import Any, Dict, List, Tuple # NOQA from sphinx.application import Sphinx # NOQA - from sphinx.util.typing import unicode # NOQA logger = logging.getLogger(__name__) @@ -48,22 +47,22 @@ class ChangesBuilder(Builder): self.templates.init(self, self.theme) def get_outdated_docs(self): - # type: () -> unicode + # type: () -> str return self.outdir typemap = { 'versionadded': 'added', 'versionchanged': 'changed', 'deprecated': 'deprecated', - } # type: Dict[unicode, unicode] + } def write(self, *ignored): # type: (Any) -> None version = self.config.version domain = cast(ChangeSetDomain, self.env.get_domain('changeset')) - libchanges = {} # type: Dict[unicode, List[Tuple[unicode, unicode, int]]] - apichanges = [] # type: List[Tuple[unicode, unicode, int]] - otherchanges = {} # type: Dict[Tuple[unicode, unicode], List[Tuple[unicode, unicode, int]]] # NOQA + libchanges = {} # type: Dict[str, List[Tuple[str, str, int]]] + apichanges = [] # type: List[Tuple[str, str, int]] + otherchanges = {} # type: Dict[Tuple[str, str], List[Tuple[str, str, int]]] if version not in self.env.versionchanges: logger.info(bold(__('no changes in version %s.') % version)) return @@ -123,7 +122,7 @@ class ChangesBuilder(Builder): '.. deprecated:: %s' % version] def hl(no, line): - # type: (int, unicode) -> unicode + # type: (int, str) -> str line = '<a name="L%s"> </a>' % no + htmlescape(line) for x in hltext: if x in line: @@ -157,7 +156,7 @@ class ChangesBuilder(Builder): self.outdir) def hl(self, text, version): - # type: (unicode, unicode) -> unicode + # type: (str, str) -> str text = htmlescape(text) for directive in ['versionchanged', 'versionadded', 'deprecated']: text = text.replace('.. %s:: %s' % (directive, version), @@ -170,7 +169,7 @@ class ChangesBuilder(Builder): def setup(app): - # type: (Sphinx) -> Dict[unicode, Any] + # type: (Sphinx) -> Dict[str, Any] app.add_builder(ChangesBuilder) return { |