-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
DeprecationWarning: asyncio.iscoroutinefunction deprecated in Python 3.14+
Description
When using slowapi with Python 3.14, the following deprecation warning is raised:
/usr/local/lib/python3.14/site-packages/slowapi/extension.py:717: DeprecationWarning:
'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16;
use inspect.iscoroutinefunction() instead
Environment
- Python version: 3.14
- slowapi version: 0.1.9
- FastAPI version: 0.135.1
Expected behavior
inspect.iscoroutinefunction() should be used instead of asyncio.iscoroutinefunction() as recommended by the Python docs.
Suggested fix
In extension.py line 717, replace:
if asyncio.iscoroutinefunction(func):with:
if inspect.iscoroutinefunction(func):This is a one-line fix. Could you let me know if there is a planned release that will address this? Happy to open a PR if that would help!
Thank you for maintaining this library 🙏
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels