From 2ee634bfdada724bccd56b372670538f2f20b3bc Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 3 May 2021 23:17:30 +0900 Subject: refactor: Add Optional to type annotations --- sphinx/domains/cpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sphinx/domains/cpp.py') diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 7bb1e49aa..6c551b4a7 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -7594,7 +7594,7 @@ class CPPDomain(Domain): def _resolve_xref_inner(self, env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, - contnode: Element) -> Tuple[Element, str]: + contnode: Element) -> Tuple[Optional[Element], Optional[str]]: # add parens again for those that could be functions if typ == 'any' or typ == 'func': target += '()' @@ -7743,7 +7743,7 @@ class CPPDomain(Domain): def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder, typ: str, target: str, node: pending_xref, contnode: Element - ) -> Element: + ) -> Optional[Element]: return self._resolve_xref_inner(env, fromdocname, builder, typ, target, node, contnode)[0] -- cgit v1.2.1