Skip to content

Commit c96fdf7

Browse files
Fix typo in ConnectionPool and AsyncConnectionPool (#908)
Co-authored-by: Tom Christie <[email protected]>
1 parent a8f8098 commit c96fdf7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

httpcore/_async/connection_pool.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
262262
queued_requests = [request for request in self._requests if request.is_queued()]
263263
for pool_request in queued_requests:
264264
origin = pool_request.request.url.origin
265-
avilable_connections = [
265+
available_connections = [
266266
connection
267267
for connection in self._connections
268268
if connection.can_handle_request(origin) and connection.is_available()
@@ -277,9 +277,9 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
277277
# 2. We can create a new connection to handle the request.
278278
# 3. We can close an idle connection and then create a new connection
279279
# to handle the request.
280-
if avilable_connections:
280+
if available_connections:
281281
# log: "reusing existing connection"
282-
connection = avilable_connections[0]
282+
connection = available_connections[0]
283283
pool_request.assign_to_connection(connection)
284284
elif len(self._connections) < self._max_connections:
285285
# log: "creating new connection"

httpcore/_sync/connection_pool.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
262262
queued_requests = [request for request in self._requests if request.is_queued()]
263263
for pool_request in queued_requests:
264264
origin = pool_request.request.url.origin
265-
avilable_connections = [
265+
available_connections = [
266266
connection
267267
for connection in self._connections
268268
if connection.can_handle_request(origin) and connection.is_available()
@@ -277,9 +277,9 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
277277
# 2. We can create a new connection to handle the request.
278278
# 3. We can close an idle connection and then create a new connection
279279
# to handle the request.
280-
if avilable_connections:
280+
if available_connections:
281281
# log: "reusing existing connection"
282-
connection = avilable_connections[0]
282+
connection = available_connections[0]
283283
pool_request.assign_to_connection(connection)
284284
elif len(self._connections) < self._max_connections:
285285
# log: "creating new connection"

0 commit comments

Comments
 (0)