🐛 Check async generator before regular generator to execute that first, as that's the special case

This commit is contained in:
Sebastián Ramírez 2025-12-04 00:48:33 +01:00
parent ce8baaeda3
commit 230c550220
1 changed files with 3 additions and 3 deletions

View File

@ -548,10 +548,10 @@ async def _solve_generator(
*, dependant: Dependant, stack: AsyncExitStack, sub_values: Dict[str, Any]
) -> Any:
assert dependant.call
if dependant.is_gen_callable:
cm = contextmanager_in_threadpool(contextmanager(dependant.call)(**sub_values))
elif dependant.is_async_gen_callable:
if dependant.is_async_gen_callable:
cm = asynccontextmanager(dependant.call)(**sub_values)
elif dependant.is_gen_callable:
cm = contextmanager_in_threadpool(contextmanager(dependant.call)(**sub_values))
return await stack.enter_async_context(cm)