Skip to content

Commit a57e3ee

Browse files
committed
Fix typing that isn't compatible with Python < 3.10.
1 parent 906bae1 commit a57e3ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flask_babel/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from types import SimpleNamespace
1313
from datetime import datetime
1414
from contextlib import contextmanager
15-
from typing import List, Callable, Optional
15+
from typing import List, Callable, Optional, Union
1616

1717
from babel.support import Translations, NullTranslations
1818
from flask import current_app, g
@@ -237,7 +237,7 @@ def _resolve_directories(directories: List[str], app=None):
237237
yield os.path.join(app.root_path, path)
238238

239239

240-
def get_translations() -> Translations | NullTranslations:
240+
def get_translations() -> Union[Translations, NullTranslations]:
241241
"""Returns the correct gettext translations that should be used for
242242
this request. This will never fail and return a dummy translation
243243
object if used outside the request or if a translation cannot be found.

0 commit comments

Comments
 (0)