Check whether CAN sockets are supported on this host.
()
| 105 | return struct.unpack("I", r)[0] |
| 106 | |
| 107 | def _have_socket_can(): |
| 108 | """Check whether CAN sockets are supported on this host.""" |
| 109 | try: |
| 110 | s = socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) |
| 111 | except (AttributeError, OSError): |
| 112 | return False |
| 113 | else: |
| 114 | s.close() |
| 115 | return True |
| 116 | |
| 117 | def _have_socket_can_isotp(): |
| 118 | """Check whether CAN ISOTP sockets are supported on this host.""" |
no test coverage detected
searching dependent graphs…