Skip to content

Commit

Permalink
Fix typing that isn't compatible with Python < 3.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
TkTech committed Jan 29, 2023
1 parent 906bae1 commit a57e3ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_babel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from types import SimpleNamespace
from datetime import datetime
from contextlib import contextmanager
from typing import List, Callable, Optional
from typing import List, Callable, Optional, Union

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


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

0 comments on commit a57e3ee

Please sign in to comment.