MCPcopy Index your code
hub / github.com/RustPython/RustPython / _have_socket_can_isotp

Function _have_socket_can_isotp

Lib/test/test_socket.py:115–123  ·  view source on GitHub ↗

Check whether CAN ISOTP sockets are supported on this host.

()

Source from the content-addressed store, hash-verified

113 return True
114
115def _have_socket_can_isotp():
116 """Check whether CAN ISOTP sockets are supported on this host."""
117 try:
118 s = socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_ISOTP)
119 except (AttributeError, OSError):
120 return False
121 else:
122 s.close()
123 return True
124
125def _have_socket_can_j1939():
126 """Check whether CAN J1939 sockets are supported on this host."""

Callers 1

test_socket.pyFile · 0.85

Calls 2

socketMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected