|
|
@ -637,14 +637,12 @@ async def solve_dependencies( |
|
|
|
elif is_coroutine_callable(call): |
|
|
|
solved = await call(**solved_result.values) |
|
|
|
else: |
|
|
|
stack = request.scope.get("fastapi_astack") |
|
|
|
assert isinstance(stack, AsyncExitStack) |
|
|
|
called = await run_in_threadpool(call, **solved_result.values) |
|
|
|
if hasattr(called, "__aenter__"): |
|
|
|
solved = await stack.enter_async_context(called) |
|
|
|
solved = await async_exit_stack.enter_async_context(called) |
|
|
|
elif hasattr(called, "__enter__"): |
|
|
|
cm = contextmanager_in_threadpool(called) |
|
|
|
solved = await stack.enter_async_context(cm) |
|
|
|
solved = await async_exit_stack.enter_async_context(cm) |
|
|
|
else: |
|
|
|
solved = called |
|
|
|
if sub_dependant.name is not None: |
|
|
|