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