You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gracefully handle errors when binding SocketCAN fails.
The parent class BusABC expects to be shutdown properly, checked via
its self._is_shutdown flag during object deletion. But that flag is
only set when the base class shutdown() is called, which doesn't
happen if instantiation of the concrete class failed in can.Bus(). So
there is no way to avoid the warning message "SocketcanBus was not
properly shut down" if the constructor raised an exception.
This change addresses that issue for the SocketCAN interface, by
catching an OSError exception in bind_socket(), logging it, and
calling self.shutdown().
0 commit comments