Skip to content

Commit

Permalink
fix: 🐛 💚 typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bashirmindee committed Mar 14, 2024
1 parent 4b28ccf commit 0766bac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tawazi/node/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def _validate_tuple(func: Callable[..., Any], unpack_to: int) -> Optional[bool]:
# maybe typing is not provided!
if not r_type:
return None
if isinstance(r_type, str):
# eval is safe to use because the user is providing the typing and evaluating it locally
r_type = eval(r_type, func.__globals__) # noqa: PGH001 # nosec B307
is_tuple = r_type.__origin__ is tuple
if not is_tuple:
return None
Expand Down

0 comments on commit 0766bac

Please sign in to comment.