fixup! Add support for async generator injections

This commit is contained in:
ZipFile 2025-06-03 16:40:39 +00:00
parent e55d11e6ab
commit c8a40d97f1
2 changed files with 2 additions and 3 deletions

View File

@ -38,8 +38,8 @@ cdef class DependencyResolver:
self.injections = injections
self.closings = closings
async def _await_injection(self, p: KWPair, /) -> None:
self.to_inject[p.name] = await p.value
async def _await_injection(self, kw_pair: KWPair, /) -> None:
self.to_inject[kw_pair.name] = await kw_pair.value
cdef object _await_injections(self, to_await: list):
return gather(*map(self._await_injection, to_await))

View File

@ -1054,7 +1054,6 @@ def _get_async_patched(fn: F, patched: PatchedCallable) -> F:
return cast(F, _patched)
# Async generators too...
def _get_async_gen_patched(fn: F, patched: PatchedCallable) -> F:
@functools.wraps(fn)
async def _patched(*args: Any, **raw_kwargs: Any) -> AsyncIterator[Any]: