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

Function _have_socket_bluetooth

Lib/test/test_socket.py:171–181  ·  view source on GitHub ↗

Check whether AF_BLUETOOTH sockets are supported on this host.

()

Source from the content-addressed store, hash-verified

169
170
171def _have_socket_bluetooth():
172 """Check whether AF_BLUETOOTH sockets are supported on this host."""
173 try:
174 # RFCOMM is supported by all platforms with bluetooth support. Windows
175 # does not support omitting the protocol.
176 s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
177 except (AttributeError, OSError):
178 return False
179 else:
180 s.close()
181 return True
182
183
184def _have_socket_bluetooth_l2cap():

Callers 1

test_socket.pyFile · 0.85

Calls 2

socketMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected