Skip to content

Commit e9ccbaa

Browse files
committed
remove misc changes
1 parent efd1eac commit e9ccbaa

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

reflex/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def validate_field_name(bases: List[Type["BaseModel"]], field_name: str) -> None
2929
for base in bases:
3030
if not reload and getattr(base, field_name, None):
3131
pass
32-
except TypeError as e:
32+
except TypeError as te:
3333
raise VarNameError(
3434
f'State var "{field_name}" in {base} has been shadowed by a substate var; '
3535
f'use a different field name instead".'
36-
) from e
36+
) from te
3737

3838

3939
# monkeypatch pydantic validate_field_name method to skip validating

reflex/event.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ def no_args_event_spec() -> Tuple[()]:
590590
stop_propagation = EventChain(events=[], args_spec=no_args_event_spec).stop_propagation
591591
prevent_default = EventChain(events=[], args_spec=no_args_event_spec).prevent_default
592592

593+
593594
T = TypeVar("T")
594595
U = TypeVar("U")
595596

@@ -1290,10 +1291,10 @@ def call_event_handler(
12901291
compare_result = typehint_issubclass(
12911292
args_types_without_vars[i], type_hints_of_provided_callback[arg]
12921293
)
1293-
except TypeError as e:
1294+
except TypeError as te:
12941295
raise TypeError(
12951296
f"Could not compare types {args_types_without_vars[i]} and {type_hints_of_provided_callback[arg]} for argument {arg} of {event_callback.fn.__qualname__} provided for {key}."
1296-
) from e
1297+
) from te
12971298

12981299
if compare_result:
12991300
type_match_found[arg] = True
@@ -1877,6 +1878,7 @@ def __call__(self, *args: Var) -> Any:
18771878

18781879
ARGS = TypeVarTuple("ARGS")
18791880

1881+
18801882
LAMBDA_OR_STATE = TypeAliasType(
18811883
"LAMBDA_OR_STATE",
18821884
LambdaEventCallback[Unpack[ARGS]] | EventCallback[Unpack[ARGS]],
@@ -1899,6 +1901,7 @@ def __call__(self, *args: Var) -> Any:
18991901
"EventType", ItemOrList[IndividualEventType[Unpack[ARGS]]], type_params=(ARGS,)
19001902
)
19011903

1904+
19021905
if TYPE_CHECKING:
19031906
from reflex.state import BaseState
19041907

reflex/utils/types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,10 @@ def _issubclass(cls: GenericType, cls_check: GenericType, instance: Any = None)
474474
# Check if the types match.
475475
try:
476476
return cls_check_base == Any or issubclass(cls_base, cls_check_base)
477-
except TypeError as e:
477+
except TypeError as te:
478478
# These errors typically arise from bad annotations and are hard to
479479
# debug without knowing the type that we tried to compare.
480-
raise TypeError(f"Invalid type for issubclass: {cls_base}") from e
480+
raise TypeError(f"Invalid type for issubclass: {cls_base}") from te
481481

482482

483483
def does_obj_satisfy_typed_dict(obj: Any, cls: GenericType) -> bool:

0 commit comments

Comments
 (0)