Skip to content

Commit 79b4a54

Browse files
committed
fix: change validator to raise type error if failed instead of assert
1 parent 7a9e677 commit 79b4a54

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

opensourceleg/actuators/dephy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ def MOTOR_CONSTANTS(self, value: MOTOR_CONSTANTS) -> None:
709709
value (MOTOR_CONSTANTS): New motor constants to set.
710710
"""
711711

712-
assert isinstance(value, MOTOR_CONSTANTS), f"Expected MOTOR_CONSTANTS, got {type(value)}"
712+
if not isinstance(value, MOTOR_CONSTANTS):
713+
raise TypeError(f"Expected MOTOR_CONSTANTS, got {type(value)}")
713714
self._MOTOR_CONSTANTS = value
714715
self._update_derived_constants()
715716

0 commit comments

Comments
 (0)