[hooks] fix check for .events attribute in hooks
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 23 Sep 2009 09:52:52 +0200
changeset 3394 51a25bdd7bdc
parent 3393 58a62864bae4
child 3395 405f393bcac0
[hooks] fix check for .events attribute in hooks
server/hook.py
--- a/server/hook.py	Wed Sep 23 09:52:09 2009 +0200
+++ b/server/hook.py	Wed Sep 23 09:52:52 2009 +0200
@@ -64,8 +64,10 @@
     def register(self, obj, **kwargs):
         try:
             iter(obj.events)
+        except AttributeError:
+            raise
         except:
-            raise Exception('bad .events attribute %s on %s' % (obj.event, obj))
+            raise Exception('bad .events attribute %s on %s' % (obj.events, obj))
         for event in obj.events:
             if event not in ALL_HOOKS:
                 raise Exception('bad event %s on %s' % (event, obj))