Skip to content

Commit

Permalink
Move compatibility logic into its own module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 20, 2024
1 parent e6769b2 commit 7d1571b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@

from more_itertools import windowed_complete
from typeguard import typechecked
try:
# Python 3.9+
from typing import Annotated
except ImportError:
from typing_extensions import Annotated

from .compat.py38 import Annotated


class UnknownClassicalModeError(Exception):
Expand Down
Empty file added inflect/compat/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions inflect/compat/py38.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sys


if sys.version_info > (3, 9):
from typing import Annotated
else: # pragma: no cover
from typing_extensions import Annotated # noqa: F401

0 comments on commit 7d1571b

Please sign in to comment.