File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 55 AsyncIterable ,
66 AsyncIterator ,
77 Iterable ,
8- Iterator ,
98 List ,
109 Optional ,
1110 Type ,
@@ -272,12 +271,15 @@ def _assign_requests_to_connections(self) -> List[AsyncConnectionInterface]:
272271 continue
273272
274273 origin = pool_request .request .url .origin
275- available_connections_iter : Iterator [AsyncConnectionInterface ] = (
276- connection
277- for connection in self ._connections
278- if connection .can_handle_request (origin ) and connection .is_available ()
274+ available_connection = next (
275+ (
276+ connection
277+ for connection in self ._connections
278+ if connection .can_handle_request (origin )
279+ and connection .is_available ()
280+ ),
281+ None ,
279282 )
280- available_connection = next (available_connections_iter , None )
281283
282284 # There are three cases for how we may be able to handle the request:
283285 #
Original file line number Diff line number Diff line change 55 Iterable ,
66 Iterator ,
77 Iterable ,
8- Iterator ,
98 List ,
109 Optional ,
1110 Type ,
@@ -272,12 +271,15 @@ def _assign_requests_to_connections(self) -> List[ConnectionInterface]:
272271 continue
273272
274273 origin = pool_request .request .url .origin
275- available_connections_iter : Iterator [ConnectionInterface ] = (
276- connection
277- for connection in self ._connections
278- if connection .can_handle_request (origin ) and connection .is_available ()
274+ available_connection = next (
275+ (
276+ connection
277+ for connection in self ._connections
278+ if connection .can_handle_request (origin )
279+ and connection .is_available ()
280+ ),
281+ None ,
279282 )
280- available_connection = next (available_connections_iter , None )
281283
282284 # There are three cases for how we may be able to handle the request:
283285 #
You can’t perform that action at this time.
0 commit comments