##// END OF EJS Templates
FIX: bare functions in callback registry on bogus unregister...
Thomas A Caswell -
Show More
@@ -69,8 +69,11 b' class EventManager(object):'
69
69
70 # Remove callback in case ``function`` was adapted by `backcall`.
70 # Remove callback in case ``function`` was adapted by `backcall`.
71 for callback in self.callbacks[event]:
71 for callback in self.callbacks[event]:
72 if callback.__wrapped__ is function:
72 try:
73 return self.callbacks[event].remove(callback)
73 if callback.__wrapped__ is function:
74 return self.callbacks[event].remove(callback)
75 except AttributeError:
76 pass
74
77
75 raise ValueError('Function {!r} is not registered as a {} callback'.format(function, event))
78 raise ValueError('Function {!r} is not registered as a {} callback'.format(function, event))
76
79
General Comments 0
You need to be logged in to leave comments. Login now