Skip to content

Commit

Permalink
remove deprecated asyncio.iscoroutinefunction and use `inspect.isco…
Browse files Browse the repository at this point in the history
…routinefunction`
  • Loading branch information
ArtemIsmagilov authored and unode committed Jul 19, 2024
1 parent 4d78f22 commit d87a4e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmpy_bot/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
)

self.function = function
self.is_coroutine = asyncio.iscoroutinefunction(function)
self.is_coroutine = inspect.iscoroutinefunction(function)
self.is_click_function: bool = False
self.matcher = matcher
self.metadata = metadata
Expand Down Expand Up @@ -100,7 +100,7 @@ def __init__(

if self.is_click_function:
_function = self.function.callback
if asyncio.iscoroutinefunction(_function):
if inspect.iscoroutinefunction(_function):
raise ValueError(
"Combining click functions and coroutines is currently not supported!"
" Consider using a regular function, which will be threaded by default."
Expand Down

0 comments on commit d87a4e3

Please sign in to comment.