Skip to content

Commit 2f0d8bb

Browse files
more robust handling of emit's "to" argument (Fixes #689)
1 parent 0e18945 commit 2f0d8bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

socketio/base_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ def get_namespaces(self):
3939
def get_participants(self, namespace, room):
4040
"""Return an iterable with the active participants in a room."""
4141
ns = self.rooms[namespace]
42-
if room is None or isinstance(room, str):
43-
participants = ns[room]._fwdm.copy() if room in ns else {}
44-
else:
42+
if hasattr(room, '__len__') and not isinstance(room, str):
4543
participants = ns[room[0]]._fwdm.copy() if room[0] in ns else {}
4644
for r in room[1:]:
4745
participants.update(ns[r]._fwdm if r in ns else {})
46+
else:
47+
participants = ns[room]._fwdm.copy() if room in ns else {}
4848
for sid, eio_sid in participants.items():
4949
yield sid, eio_sid
5050

0 commit comments

Comments
 (0)