Skip to content

Commit b6d7c55

Browse files
committed
prevent possible type conversions
1 parent 195a36d commit b6d7c55

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

candle/candle_bus.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def __init__(self, channel: Union[int, str], can_filters: Optional[can.typecheck
1515
manufacture: Optional[str] = None, product: Optional[str] = None,
1616
serial_number: Optional[str] = None, **kwargs) -> None:
1717

18+
# If ignore_config is not set, can.util.cast_from_string may cause unexpected type conversions.
19+
manufacture = str(manufacture)
20+
product = str(product)
21+
serial_number = str(serial_number)
22+
1823
# Parse channel.
1924
if isinstance(channel, str):
2025
serial_number, channel_number = channel.split(':')

0 commit comments

Comments
 (0)