mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 05:54:19 +02:00
Remove deprecated asyncio.iscoroutinefunction fallback (#3767)
The `asyncio.iscoroutinefunction` call is deprecated in Python 3.14 and slated for removal in 3.16. Since `is_coroutine_function` already unwraps `functools.partial` layers before checking, the asyncio fallback is redundant on all supported Python versions — it can never return True when `inspect.iscoroutinefunction` returned False on the unwrapped function. Fixes #3765 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c642d6a5cf
commit
0212a718c7
1 changed files with 1 additions and 2 deletions
|
|
@ -1,6 +1,5 @@
|
|||
"""Async utilities for FastMCP."""
|
||||
|
||||
import asyncio
|
||||
import functools
|
||||
import inspect
|
||||
from collections.abc import Awaitable, Callable
|
||||
|
|
@ -21,7 +20,7 @@ def is_coroutine_function(fn: Any) -> bool:
|
|||
"""
|
||||
while isinstance(fn, functools.partial):
|
||||
fn = fn.func
|
||||
return inspect.iscoroutinefunction(fn) or asyncio.iscoroutinefunction(fn)
|
||||
return inspect.iscoroutinefunction(fn)
|
||||
|
||||
|
||||
async def call_sync_fn_in_threadpool(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue