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

Function resolve_address

Lib/test/test_timeout.py:14–22  ·  view source on GitHub ↗

Resolve an (host, port) to an address. We must perform name resolution before timeout tests, otherwise it will be performed by connect().

(host, port)

Source from the content-addressed store, hash-verified

12
13@functools.lru_cache()
14def resolve_address(host, port):
15 """Resolve an (host, port) to an address.
16
17 We must perform name resolution before timeout tests, otherwise it will be
18 performed by connect().
19 """
20 with socket_helper.transient_internet(host):
21 return socket.getaddrinfo(host, port, socket.AF_INET,
22 socket.SOCK_STREAM)[0][4]
23
24
25class CreationTestCase(unittest.TestCase):

Callers 2

setUpMethod · 0.85
testConnectTimeoutMethod · 0.85

Calls 1

getaddrinfoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…