Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions slowapi/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
The starlette extension to rate-limit requests
"""

import asyncio
import functools
import inspect
import itertools
Expand Down Expand Up @@ -713,7 +712,7 @@ def decorator(func: Callable[..., Response]):
f'No "request" or "websocket" argument on function "{func}"'
)

if asyncio.iscoroutinefunction(func):
if inspect.iscoroutinefunction(func):
# Handle async request/response functions.
@functools.wraps(func)
async def async_wrapper(*args: Any, **kwargs: Any) -> Response:
Expand Down Expand Up @@ -870,7 +869,7 @@ def exempt(self, obj):

self._exempt_routes.add(name)

if asyncio.iscoroutinefunction(obj):
if inspect.iscoroutinefunction(obj):

@wraps(obj)
async def __async_inner(*a, **k):
Expand Down