Skip to content

Commit 033be12

Browse files
authored
Fix initialization order in EtasBus (#1704)
super.__init__ calls set_filters, which is only permissible after the corresponding structures have been created in the child constructor. Hence, super.__init__ must be called after the child has finished initialization. Fixes #1693
1 parent cc72abb commit 033be12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

can/interfaces/etas/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def __init__(
1818
data_bitrate: int = 2000000,
1919
**kwargs: Dict[str, any],
2020
):
21-
super().__init__(channel=channel, **kwargs)
22-
2321
self.receive_own_messages = receive_own_messages
2422
self._can_protocol = can.CanProtocol.CAN_FD if fd else can.CanProtocol.CAN_20
2523

@@ -119,6 +117,9 @@ def __init__(
119117

120118
self.channel_info = channel
121119

120+
# Super call must be after child init since super calls set_filters
121+
super().__init__(channel=channel, **kwargs)
122+
122123
def _recv_internal(
123124
self, timeout: Optional[float]
124125
) -> Tuple[Optional[can.Message], bool]:

0 commit comments

Comments
 (0)