Browse Source

Avoid KeyError in is_connected.

pull/22/head
Chris Doehring 9 years ago
parent
commit
cba6c3ed8b
  1. 6
      socketio/base_manager.py

6
socketio/base_manager.py

@ -35,8 +35,10 @@ class BaseManager(object):
self.enter_room(sid, namespace, sid) self.enter_room(sid, namespace, sid)
def is_connected(self, sid, namespace): def is_connected(self, sid, namespace):
return sid in self.rooms[namespace][None] and \ try:
self.rooms[namespace][None][sid] return self.rooms[namespace][None][sid]
except KeyError:
pass
def disconnect(self, sid, namespace): def disconnect(self, sid, namespace):
"""Register a client disconnect from a namespace.""" """Register a client disconnect from a namespace."""

Loading…
Cancel
Save