From 033be12ab150c1c1db34fe5a2f30ac27976e65e0 Mon Sep 17 00:00:00 2001 From: Lukas Magel Date: Fri, 8 Dec 2023 09:48:06 +0100 Subject: [PATCH] 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 --- 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]: