Skip to content

Commit

Permalink
(fix) evaluate_forwardref: support Python 3.13/3.12.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-pelykh committed Oct 31, 2024
1 parent 207c073 commit 52495ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fastapi_events/handlers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
else:
# Even though it is the right signature for python 3.9, mypy complains with
# `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast...
return cast(Any, type_)._evaluate(globalns, localns, set())
# Python 3.13/3.12.4+ made `recursive_guard` a kwarg, so name it explicitly to avoid:
# TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
return cast(Any, type_)._evaluate(globalns, localns, recursive_guard=set())


def get_typed_annotation(
Expand Down

0 comments on commit 52495ff

Please sign in to comment.