From 624365e70ff7ac2cbe36d8f2b4480a12c2e6970d Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 4 Dec 2018 23:31:00 +0900 Subject: [PATCH] Fix annotation of Catalog.add(); it takes an Element object --- sphinx/builders/gettext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index fd72437b0..04c235cf3 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -33,7 +33,7 @@ from sphinx.util.tags import Tags if False: # For type annotation - from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple # NOQA + from typing import Any, DefaultDict, Dict, Iterable, List, Set, Tuple, Union # NOQA from docutils import nodes # NOQA from sphinx.application import Sphinx # NOQA from sphinx.util.i18n import CatalogInfo # NOQA @@ -75,7 +75,7 @@ class Catalog: # msgid -> file, line, uid def add(self, msg, origin): - # type: (unicode, MsgOrigin) -> None + # type: (unicode, Union[nodes.Element, MsgOrigin]) -> None if not hasattr(origin, 'uid'): # Nodes that are replicated like todo don't have a uid, # however i18n is also unnecessary.