MCPcopy Index your code
hub / github.com/python/cpython / _have_socket_can_j1939

Function _have_socket_can_j1939

Lib/test/test_socket.py:127–135  ·  view source on GitHub ↗

Check whether CAN J1939 sockets are supported on this host.

()

Source from the content-addressed store, hash-verified

125 return True
126
127def _have_socket_can_j1939():
128 """Check whether CAN J1939 sockets are supported on this host."""
129 try:
130 s = socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939)
131 except (AttributeError, OSError):
132 return False
133 else:
134 s.close()
135 return True
136
137def _have_socket_rds():
138 """Check whether RDS 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…