Return a fresh :class:`HTTPConnection`.
(self)
| 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 | """ |
no outgoing calls