BurntSushi/xpybutil — pull request #3 by whitelynx (2013-02-25 00:16:58+00:00)
Title: Fixed exception when calling update_keyboard_mapping.

When calling `update_keyboard_mapping`, if the set of changes included any keys that were currently bound, `__regrab` would cause an exception:
```python
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 440, in _run_callback
callback()
File "/home/whitelynx/devel/personal/fttpwm/fttpwm/x.py", line 153, in updateKeyboardMapping
xpybutil.keybind.update_keyboard_mapping(self.pendingUpdateKeyboardMapping)
File "/usr/lib/python2.7/site-packages/xpybutil/keybind.py", line 442, in update_keyboard_mapping
__regrab(changes)
File "/usr/lib/python2.7/site-packages/xpybutil/keybind.py", line 479, in __regrab
for wid, mods, kc in __keybinds:
RuntimeError: dictionary changed size during iteration
```

This patch fixes the exception, but unfortunately, `update_keyboard_mapping` sometimes still doesn't correctly re-bind keys whose mappings have changed. (I'm still tracking that down)