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/transforms/i18n.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sphinx/transforms/i18n.py') diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 8f6d37d8d..2a5d6f121 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -10,7 +10,7 @@ from os import path from textwrap import indent -from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Type, TypeVar +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, TypeVar from docutils import nodes from docutils.io import StringInput @@ -416,7 +416,7 @@ class Locale(SphinxTransform): .format(old_xref_rawsources, new_xref_rawsources), location=node) - def get_ref_key(node: addnodes.pending_xref) -> Tuple[str, str, str]: + def get_ref_key(node: addnodes.pending_xref) -> Optional[Tuple[str, str, str]]: case = node["refdomain"], node["reftype"] if case == ('std', 'term'): return None -- cgit v1.2.1