Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #70 from lilydjwg/master

fix: a socket may be unregistered when not registered

Should fix #68
  • Loading branch information...
commit bb7efe2ded0a839ad4ff261f9855c026097cdf72 2 parents 5577843 + 45561b5
@Jajcus authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 pyxmpp2/mainloop/poll.py
View
7 pyxmpp2/mainloop/poll.py
@@ -63,7 +63,12 @@ def _configure_io_handler(self, handler):
fileno = handler.fileno()
if old_fileno is not None and fileno != old_fileno:
del self._handlers[old_fileno]
- self.poll.unregister(old_fileno)
+ try:
+ self.poll.unregister(old_fileno)
+ except KeyError:
+ # The socket has changed, but the old one isn't registered,
+ # e.g. ``prepare`` wants to connect again
+ pass
if not prepared:
self._unprepared_handlers[handler] = fileno
if not fileno:
Please sign in to comment.
Something went wrong with that request. Please try again.