Skip to content

Commit bd56bed

Browse files
committed
safe issubclass
1 parent fed2cec commit bd56bed

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@
120120
"packages/reflex-components-sonner/src/reflex_components_sonner/toast.pyi": "f09c503c4ab880c13c13d6fa67d708b8",
121121
"reflex/__init__.pyi": "7696c38fd9c04a598518b49c5185c414",
122122
"reflex/components/__init__.pyi": "55bb242d5e5428db329b88b4923c2ba5",
123-
"reflex/experimental/memo.pyi": "d16eccf33993c781e2f8bc2dd8bbd4d4"
123+
"reflex/experimental/memo.pyi": "2566571c9f68fce5e8178e8acac11944"
124124
}

reflex/experimental/memo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from reflex_core.constants.state import CAMEL_CASE_MEMO_MARKER
1818
from reflex_core.utils import format
1919
from reflex_core.utils.imports import ImportVar
20+
from reflex_core.utils.types import safe_issubclass
2021
from reflex_core.vars import VarData
2122
from reflex_core.vars.base import LiteralVar, Var
2223
from reflex_core.vars.function import (
@@ -254,11 +255,11 @@ def _is_component_annotation(annotation: Any) -> bool:
254255
"""
255256
origin = get_origin(annotation) or annotation
256257
return isinstance(origin, type) and (
257-
issubclass(origin, Component)
258+
safe_issubclass(origin, Component)
258259
or bool(
259-
issubclass(origin, Var)
260+
safe_issubclass(origin, Var)
260261
and (args := get_args(annotation))
261-
and issubclass(args[0], Component)
262+
and safe_issubclass(args[0], Component)
262263
)
263264
)
264265

0 commit comments

Comments
 (0)