Skip to content

asyncio.iscoroutinefunction() deprecation warnings in Python 3.14 #431

@paultiq

Description

@paultiq

In 3.14, async code using filelock now emits the following warning: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead

Reproduction

 python -c "import asyncio, filelock; asyncio.run(filelock.AsyncFileLock('x').acquire(timeout=1))"

....venv\Lib\site-packages\filelock\asyncio.py:268: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead

What needs to change

if asyncio.iscoroutinefunction(method):

Python deprecation notice

https://docs.python.org/3.14/whatsnew/3.14.html explains: "asyncio.iscoroutinefunction() is deprecated and will be removed in Python 3.16; use inspect.iscoroutinefunction() instead. (Contributed by Jiahao Li and Kumar Aditya in gh-122875.)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions