Skip to content

fix: replace deprecated asyncio.iscoroutinefunction with inspect variant - #291

Open
Mukller wants to merge 1 commit into
laurentS:masterfrom
Mukller:fix/iscoroutinefunction-deprecation
Open

Mukller wants to merge 1 commit into
laurentS:masterfrom
Mukller:fix/iscoroutinefunction-deprecation

Conversation

@Mukller

@Mukller Mukller commented Aug 22, 2026 •

Copy link
Copy Markdown

What

Replaces the two remaining asyncio.iscoroutinefunction() calls in slowapi/extension.py (L720, L877) with inspect.iscoroutinefunction(), fixing the DeprecationWarning reported in #263.

asyncio.iscoroutinefunction is deprecated as of Python 3.14; inspect.iscoroutinefunction is the documented drop-in replacement тАФ and it's already what slowapi/middleware.py uses, so this also makes the codebase consistent.

Testing

Closes #263

Update: the 6 failed mentioned above were later traced to an unrelated float-epoch bug on master - fixed in #293, after which the suite is 103/103.

…riant

asyncio.iscoroutinefunction is deprecated since Python 3.14 and emits
a DeprecationWarning at import/call time (laurentS#263). inspect.iscoroutinefunction
is the drop-in replacement and is already used elsewhere in the codebase
(middleware.py).
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.

DeprecationWarning: asyncio.iscoroutinefunction

1 participant