From ce4355e3351a9ae28c01e4027887f0c75e134b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Sun, 13 Jul 2025 00:34:31 -0600 Subject: [PATCH] Replace deprecated `asyncio.iscoroutinefunction` with `inspect.iscoroutinefunction` Deprecated in Python 3.14 and will be removed in Python 3.16. --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 54c75a027..ab9518cc4 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -231,7 +231,7 @@ def get_request_handler( embed_body_fields: bool = False, ) -> Callable[[Request], Coroutine[Any, Any, Response]]: assert dependant.call is not None, "dependant.call must be a function" - is_coroutine = asyncio.iscoroutinefunction(dependant.call) + is_coroutine = inspect.iscoroutinefunction(dependant.call) is_body_form = body_field and isinstance(body_field.field_info, params.Form) if isinstance(response_class, DefaultPlaceholder): actual_response_class: Type[Response] = response_class.value