From f14f36ceb4c5b99eef00adca5552c3e548d9b911 Mon Sep 17 00:00:00 2001 From: Lukas Magel Date: Thu, 7 Dec 2023 20:36:53 +0100 Subject: [PATCH] Fix initialization order in EtasBus 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 --- can/interfaces/etas/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/can/interfaces/etas/__init__.py b/can/interfaces/etas/__init__.py index 62e060f48..b40f10b77 100644 --- a/can/interfaces/etas/__init__.py +++ b/can/interfaces/etas/__init__.py @@ -18,8 +18,6 @@ def __init__( data_bitrate: int = 2000000, **kwargs: Dict[str, any], ): - super().__init__(channel=channel, **kwargs) - self.receive_own_messages = receive_own_messages self._can_protocol = can.CanProtocol.CAN_FD if fd else can.CanProtocol.CAN_20 @@ -119,6 +117,9 @@ def __init__( self.channel_info = channel + # Super call must be after child init since super calls set_filters + super().__init__(channel=channel, **kwargs) + def _recv_internal( self, timeout: Optional[float] ) -> Tuple[Optional[can.Message], bool]: