Skip to content

Commit

Permalink
Fix for Python 3.6, refs #1
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Nov 17, 2021
1 parent 25a73fd commit fd9258f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions asyncinject/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,16 @@ async def resolve(instance, names, results=None):
ts.done(*node_group)

for node_group in plan:
awaitable_names = [name for name in node_group if name in instance._registry]
awaitables = [
instance._registry[name](
instance,
_results=results,
**{k: v for k, v in results.items() if k in instance._graph[name]},
)
for name in node_group
if name in instance._registry
for name in awaitable_names
]
awaitable_results = await asyncio.gather(*awaitables)
results.update(
{p[0].__name__: p[1] for p in zip(awaitables, awaitable_results)}
)
results.update(dict(zip(awaitable_names, awaitable_results)))

return results

0 comments on commit fd9258f

Please # to comment.