Skip to content

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

@Binilkks

Description

@Binilkks

Describe the bug
The codebase uses asyncio.iscoroutinefunction, which is deprecated in Python 3.14.
This causes deprecation warnings and may break in future Python versions.

To Reproduce
Steps to reproduce the behavior:
Run the code or tests with Python 3.14.
Observe deprecation warnings for asyncio.iscoroutinefunction

Expected behavior
The code should use inspect.iscoroutinefunction for compatibility with Python 3.14 and later.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS: macOS
  • FastAPI Utils version : 0.8.0
import fastapi_utils
import fastapi
import pydantic.utils
print(fastapi_utils.__version__)
print(fastapi.__version__)
print(pydantic.utils.version_info())
  • Python version, get it with:
python --version

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions