Skip to content

fix(tasks): use inspect.iscoroutinefunction for Python 3.14 compatibility#376

Open
SAY-5 wants to merge 1 commit into
fastapiutils:masterfrom
SAY-5:fix/373-iscoroutinefunction-py314
Open

fix(tasks): use inspect.iscoroutinefunction for Python 3.14 compatibility#376
SAY-5 wants to merge 1 commit into
fastapiutils:masterfrom
SAY-5:fix/373-iscoroutinefunction-py314

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Closes #373.

asyncio.iscoroutinefunction is deprecated in Python 3.14 and emits a DeprecationWarning. inspect.iscoroutinefunction is the documented replacement and equivalent on Python 3.12+ (generator-based @asyncio.coroutine was removed in 3.12).

Adds a regression test asserting the tasks module no longer references asyncio.iscoroutinefunction.

All 73 tests pass; ruff/black/mypy clean.

…lity

asyncio.iscoroutinefunction is deprecated in Python 3.14 and emits a
DeprecationWarning. inspect.iscoroutinefunction is the recommended
replacement and is equivalent on Python 3.12+ (asyncio.coroutine was
removed in 3.12).

Closes fastapiutils#373

Signed-off-by: SAY-5 <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Python 3.14 compatibility: use inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction

1 participant