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