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

Function _have_socket_hyperv

Lib/test/test_socket.py:195–203  ·  view source on GitHub ↗

Check whether AF_HYPERV sockets are supported on this host.

()

Source from the content-addressed store, hash-verified

193
194
195def _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

Callers 1

test_socket.pyFile · 0.85

Calls 2

socketMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected