From af0004d78edda2da1d9bbcab9742ca75976d4373 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Mon, 27 Mar 2017 20:00:16 -0700 Subject: [PATCH] Handle broadcasts to zero clients Fixes #88 --- socketio/asyncio_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/socketio/asyncio_manager.py b/socketio/asyncio_manager.py index 0ecbd46..581caa8 100644 --- a/socketio/asyncio_manager.py +++ b/socketio/asyncio_manager.py @@ -23,7 +23,8 @@ class AsyncManager(BaseManager): id = None tasks.append(self.server._emit_internal(sid, event, data, namespace, id)) - await asyncio.wait(tasks) + if tasks != []: + await asyncio.wait(tasks) async def close_room(self, room, namespace): """Remove all participants from a room.