summaryrefslogtreecommitdiff
path: root/sphinx/util/i18n.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-07 19:29:24 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-09 22:49:01 +0900
commitd25c3ad2419aa01ab0b64898ebe71bb7139928cb (patch)
tree8fd4655ec193f4bde52f75828803769d491ba734 /sphinx/util/i18n.py
parent84458da82889e28fc44988601a79c0c562e0e994 (diff)
downloadsphinx-git-d25c3ad2419aa01ab0b64898ebe71bb7139928cb.tar.gz
Update type annotations
Diffstat (limited to 'sphinx/util/i18n.py')
-rw-r--r--sphinx/util/i18n.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py
index 3a5aca58e..d647d6d05 100644
--- a/sphinx/util/i18n.py
+++ b/sphinx/util/i18n.py
@@ -12,7 +12,7 @@ import os
import re
from datetime import datetime, timezone
from os import path
-from typing import TYPE_CHECKING, Callable, Generator, List, NamedTuple, Tuple, Union
+from typing import TYPE_CHECKING, Callable, Generator, List, NamedTuple, Optional, Tuple, Union
import babel.dates
from babel.messages.mofile import write_mo
@@ -170,7 +170,7 @@ date_format_mappings = {
date_format_re = re.compile('(%s)' % '|'.join(date_format_mappings))
-def babel_format_date(date: datetime, format: str, locale: str,
+def babel_format_date(date: datetime, format: str, locale: Optional[str],
formatter: Callable = babel.dates.format_date) -> str:
if locale is None:
locale = 'en'
@@ -191,7 +191,7 @@ def babel_format_date(date: datetime, format: str, locale: str,
return format
-def format_date(format: str, date: datetime = None, language: str = None) -> str:
+def format_date(format: str, date: datetime = None, language: Optional[str] = None) -> str:
if date is None:
# If time is not specified, try to use $SOURCE_DATE_EPOCH variable
# See https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal