Skip to content

Commit

Permalink
use safe issubclass
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 committed Feb 5, 2025
1 parent 86d3350 commit 7a058ea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions reflex/vars/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

from reflex.utils import types
from reflex.utils.exceptions import VarAttributeError
from reflex.utils.types import GenericType, get_attribute_access_type, get_origin
from reflex.utils.types import (
GenericType,
get_attribute_access_type,
get_origin,
safe_issubclass,
)

from .base import (
CachedVarOperation,
Expand Down Expand Up @@ -268,7 +273,7 @@ def __getattr__(self, name: str) -> Var:

if (
is_typeddict(fixed_type)
or (isclass(fixed_type) and not issubclass(fixed_type, Mapping))
or (isclass(fixed_type) and not safe_issubclass(fixed_type, Mapping))
or (fixed_type in types.UnionTypes)
):
attribute_type = get_attribute_access_type(var_type, name)
Expand Down

0 comments on commit 7a058ea

Please sign in to comment.