Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid KeyError when no room exists #27

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Apr 12, 2016

Without this modification, base_manager.get_rooms() fails with a KeyError when no room exists:

ERROR: test_no_room (tests.test_base_manager.TestBaseManager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pdecat/workspaces/thirdparty/python-socketio/tests/test_base_manager.py", line 135, in test_no_room
    rooms = self.bm.get_rooms('123', '/foo')
  File "/home/pdecat/workspaces/thirdparty/python-socketio/socketio/base_manager.py", line 86, in get_rooms
    for room_name, room in six.iteritems(self.rooms[namespace]):
KeyError: '/foo'

@miguelgrinberg miguelgrinberg merged commit 0173306 into miguelgrinberg:master Apr 12, 2016
@miguelgrinberg
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants