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

Function _have_socket_hyperv

Lib/test/test_socket.py:197–205  ·  view source on GitHub ↗

Check whether AF_HYPERV sockets are supported on this host.

()

Source from the content-addressed store, hash-verified

195
196
197def _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

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…