Skip to content

Commit

Permalink
fix: Fix call to eval_type (missing type_params argument on Pytho…
Browse files Browse the repository at this point in the history
…n 3.13)
  • Loading branch information
pawamoy committed Aug 15, 2024
1 parent 9d2bec4 commit eae6c85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/duty/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys
import textwrap
from contextlib import suppress
from functools import cached_property
from functools import cached_property, partial
from inspect import Parameter, Signature, signature
from typing import Any, Callable, ForwardRef, Sequence, Union, get_args, get_origin

Expand All @@ -21,8 +21,12 @@
union_types = (Union,)
else:
from types import UnionType
from typing import _eval_type as eval_type # type: ignore[attr-defined]
from typing import _eval_type # type: ignore[attr-defined]

if sys.version_info >= (3, 13):
eval_type = partial(_eval_type, type_params=None)
else:
eval_type = _eval_type
union_types = (Union, UnionType)


Expand Down

0 comments on commit eae6c85

Please sign in to comment.