Check whether AF_HYPERV sockets are supported on this host.
()
| 193 | |
| 194 | |
| 195 | def _have_socket_hyperv(): |
| 196 | """Check whether AF_HYPERV sockets are supported on this host.""" |
| 197 | try: |
| 198 | s = socket.socket(socket.AF_HYPERV, socket.SOCK_STREAM, socket.HV_PROTOCOL_RAW) |
| 199 | except (AttributeError, OSError): |
| 200 | return False |
| 201 | else: |
| 202 | s.close() |
| 203 | return True |
| 204 | |
| 205 | |
| 206 | @contextlib.contextmanager |
no test coverage detected