changeset 337:5c0625957185

Fix for #106. Thanks to Walter Bell for the report and patch.
author cmlenz
date Mon, 13 Feb 2006 11:57:36 +0000
parents 5d2f3e25feaa
children 808afc6850c1
files bitten/master.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/master.py
+++ b/bitten/master.py
@@ -78,6 +78,13 @@
                 self.queues.append(self.queues.pop(idx)) # Round robin
 
     def register(self, handler):
+        if handler.name in self.handlers:
+            # The slave is for some reason still registered... this shouldn't
+            # happen in theory, but apparently it does in the real world (see
+            # #106). We simply unregister it before trying to register it
+            # again.
+            self.unregister(handler)
+
         any_match = False
         for queue in self.queues:
             if queue.register_slave(handler.name, handler.info):
Copyright (C) 2012-2017 Edgewall Software