Skip to content

Commit

Permalink
Fix for python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
kiendang committed Jun 11, 2024
1 parent 54e2676 commit 5fdd197
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/syft/src/syft/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@

def _has_config_dict(t: Any) -> bool:
return (
isinstance(t, type)
and issubclass(t, BaseModel)
# Use this instead of `issubclass`` to be compatible with python 3.10
# `inspect.isclass(t) and issubclass(t, BaseModel)`` wouldn't work with
# generics, e.g. `set[sy.UID]`, in python 3.10
(hasattr(t, "__mro__") and BaseModel in t.__mro__)
or hasattr(t, "__pydantic_config__")
)

Expand Down

0 comments on commit 5fdd197

Please sign in to comment.