Add an event handler on all objects

This commit is contained in:
Vincent Le Goff 2017-03-22 16:57:36 -07:00 committed by Griatch
parent 81f4c590bd
commit 38563a6593
4 changed files with 226 additions and 11 deletions

View file

@ -67,7 +67,7 @@ def patch_hook(typeclass, method_name):
inheritance tree for a couple of methods.
"""
hook = getattr(typeclass, method_name)
hook = getattr(typeclass, method_name, None)
def wrapper(method):
"""Wrapper around the hook."""
def overridden_hook(*args, **kwargs):