From d87a4e3d6abf64b7674db34c6c130d98fd6675d4 Mon Sep 17 00:00:00 2001 From: ArtemIsmagilov Date: Tue, 16 Jul 2024 12:57:17 +0400 Subject: [PATCH] remove deprecated `asyncio.iscoroutinefunction` and use `inspect.iscoroutinefunction` --- mmpy_bot/function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmpy_bot/function.py b/mmpy_bot/function.py index 1149d526..7b6b0ded 100644 --- a/mmpy_bot/function.py +++ b/mmpy_bot/function.py @@ -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 @@ -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."