Skip to content

Commit

Permalink
Simplify gather_requirements implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jun 15, 2024
1 parent 94ee825 commit 6e8177d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions micropip/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ async def gather_requirements(
self,
requirements: list[str] | list[Requirement],
) -> None:
requirement_promises = []
for requirement in requirements:
requirement_promises.append(self.add_requirement(requirement))

futures: list[asyncio.Future] = []
try:
for coro in requirement_promises:
futures.append(asyncio.ensure_future(coro))
for requirement in requirements:
futures.append(asyncio.ensure_future(self.add_requirement(requirement)))
await asyncio.gather(*futures)
except ValueError:
if not self.keep_going:
Expand Down

0 comments on commit 6e8177d

Please sign in to comment.