Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion typer/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
Union,
)

from typing_extensions import Literal, get_args, get_origin
if sys.version_info >= (3, 9):
from typing import Literal, get_args, get_origin
else:
from typing_extensions import Literal, get_args, get_origin

if sys.version_info < (3, 10):

Expand Down
6 changes: 5 additions & 1 deletion typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
from uuid import UUID

import click
from typing_extensions import get_args, get_origin

if sys.version_info >= (3, 9):
from typing import get_args, get_origin
else:
from typing_extensions import get_args, get_origin

from ._typing import is_union
from .completion import get_completion_inspect_parameters
Expand Down
5 changes: 4 additions & 1 deletion typer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from copy import copy
from typing import Any, Callable, Dict, List, Tuple, Type, cast

from typing_extensions import Annotated, get_args, get_origin, get_type_hints
if sys.version_info >= (3, 9):
from typing import Annotated, get_args, get_origin, get_type_hints
else:
from typing_extensions import Annotated, get_args, get_origin, get_type_hints

from .models import ArgumentInfo, OptionInfo, ParameterInfo, ParamMeta

Expand Down

0 comments on commit ec22523

Please sign in to comment.