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

Function bind_unix_socket

Lib/test/support/socket_helper.py:120–127  ·  view source on GitHub ↗

Bind a unix socket, raising SkipTest if PermissionError is raised.

(sock, addr)

Source from the content-addressed store, hash-verified

118 return port
119
120def bind_unix_socket(sock, addr):
121 """Bind a unix socket, raising SkipTest if PermissionError is raised."""
122 assert sock.family == socket.AF_UNIX
123 try:
124 sock.bind(addr)
125 except PermissionError:
126 sock.close()
127 raise unittest.SkipTest('cannot bind AF_UNIX sockets')
128
129def _is_ipv6_enabled():
130 """Check whether IPv6 is enabled on this host."""

Callers

nothing calls this directly

Calls 2

bindMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…