Don't try to run event without beforeCall

This commit is contained in:
Ruud
2013-06-14 17:24:34 +02:00
parent 9ce0c47cd4
commit c78957f55c
2 changed files with 7 additions and 12 deletions
+6 -9
View File
@@ -21,15 +21,12 @@ def addEvent(name, handler, priority = 100):
def createHandle(*args, **kwargs):
try:
parent = handler.im_self
bc = hasattr(parent, 'beforeCall')
if bc: parent.beforeCall(handler)
h = runHandler(name, handler, *args, **kwargs)
ac = hasattr(parent, 'afterCall')
if ac: parent.afterCall(handler)
except:
h = runHandler(name, handler, *args, **kwargs)
parent = handler.im_self
bc = hasattr(parent, 'beforeCall')
if bc: parent.beforeCall(handler)
h = runHandler(name, handler, *args, **kwargs)
ac = hasattr(parent, 'afterCall')
if ac: parent.afterCall(handler)
return h