MCPcopy
hub / github.com/urllib3/urllib3 / _new_conn

Method _new_conn

src/urllib3/connectionpool.py:236–254  ·  view source on GitHub ↗

Return a fresh :class:`HTTPConnection`.

(self)

Source from the content-addressed store, hash-verified

234 weakref.finalize(self, _close_pool_connections, pool)
235
236 def _new_conn(self) -> BaseHTTPConnection:
237 """
238 Return a fresh :class:`HTTPConnection`.
239 """
240 self.num_connections += 1
241 log.debug(
242 "Starting new HTTP connection (%d): %s:%s",
243 self.num_connections,
244 self.host,
245 self.port or "80",
246 )
247
248 conn = self.ConnectionCls(
249 host=self.host,
250 port=self.port,
251 timeout=self.timeout.connect_timeout,
252 **self.conn_kw,
253 )
254 return conn
255
256 def _get_conn(self, timeout: float | None = None) -> BaseHTTPConnection:
257 """

Callers 2

test_pool_timeoutsMethod · 0.95
_get_connMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_pool_timeoutsMethod · 0.76