From 0fb5b84392a0f22244bd14a5eaa9f15ce574d00c Mon Sep 17 00:00:00 2001 From: snowy Date: Sat, 27 Jul 2024 10:21:31 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E7=A7=BB=E9=99=A4liteyuki.channel.on?= =?UTF-8?q?=5Freceive()=20wrapper=E5=AF=B9async=E5=92=8Csync=20function?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/comm/channel.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/liteyuki/comm/channel.py b/liteyuki/comm/channel.py index 3dcb8ec7..49d6b7e9 100644 --- a/liteyuki/comm/channel.py +++ b/liteyuki/comm/channel.py @@ -157,16 +157,10 @@ class Channel: """ if receiver is None: for func in self._on_receive_funcs: - if is_coroutine_callable(func): - run_coroutine(func(data)) - else: - func(data) + run_coroutine(func(data)) else: for func in self._on_receive_funcs_with_receiver.get(receiver, []): - if is_coroutine_callable(func): - run_coroutine(func(data)) - else: - func(data) + run_coroutine(func(data)) def __iter__(self): return self