diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-19 10:50:40 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-19 10:56:40 +0300 |
commit | a24ef1f0cc4ebc29871289b5b92d76f4fe7b7e80 (patch) | |
tree | 4d8ba32769224823724f547289561d8be4ccf922 /sphinx/locale | |
parent | 5c14375365fe9a9f7b97cc37988d17a8a3ec56d2 (diff) |
refactor: Add Optional to type annotations
Diffstat (limited to 'sphinx/locale')
-rw-r--r-- | sphinx/locale/__init__.py | 4 |
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. |