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.