Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-04-19 10:50:40 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-04-19 10:56:40 +0300
commita24ef1f0cc4ebc29871289b5b92d76f4fe7b7e80 (patch)
tree4d8ba32769224823724f547289561d8be4ccf922 /sphinx/locale
parent5c14375365fe9a9f7b97cc37988d17a8a3ec56d2 (diff)
refactor: Add Optional to type annotations
Diffstat (limited to 'sphinx/locale')
-rw-r--r--sphinx/locale/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py
index 9812355ca..91adfef7c 100644
--- a/sphinx/locale/__init__.py
+++ b/sphinx/locale/__init__.py
@@ -12,7 +12,7 @@ import gettext
import locale
from collections import UserString, defaultdict
from gettext import NullTranslations
-from typing import Any, Callable, Dict, Iterable, List, Tuple, Union
+from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
class _TranslationProxy(UserString):
@@ -173,7 +173,7 @@ def init_console(locale_dir: str, catalog: str) -> Tuple[NullTranslations, bool]
"""
try:
# encoding is ignored
- language, _ = locale.getlocale(locale.LC_MESSAGES)
+ language, _ = locale.getlocale(locale.LC_MESSAGES) # type: Tuple[Optional[str], Any]
except AttributeError:
# LC_MESSAGES is not always defined. Fallback to the default language
# in case it is not.