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

Function create_connection

Lib/test/mock_socket.py:117–127  ·  view source on GitHub ↗
(address, timeout=socket_module._GLOBAL_DEFAULT_TIMEOUT,
                      source_address=None)

Source from the content-addressed store, hash-verified

115 return MockSocket(family)
116
117def create_connection(address, timeout=socket_module._GLOBAL_DEFAULT_TIMEOUT,
118 source_address=None):
119 try:
120 int_port = int(address[1])
121 except ValueError:
122 raise error
123 ms = MockSocket()
124 if timeout is socket_module._GLOBAL_DEFAULT_TIMEOUT:
125 timeout = getdefaulttimeout()
126 ms.settimeout(timeout)
127 return ms
128
129
130def setdefaulttimeout(timeout):

Callers 1

Calls 3

settimeoutMethod · 0.95
getdefaulttimeoutFunction · 0.85
MockSocketClass · 0.70

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…