diff --git a/src/decorator.py b/src/decorator.py index 6b0bbef2030d9678408ddad8f011ae0290506373..eaf0b7b6392e4c4bda2e6597671ff10682d26d36 100644 --- a/src/decorator.py +++ b/src/decorator.py @@ -81,6 +81,10 @@ def update_wrapper(wrapper, wrapped, create=False): # the real meat is here def _decorator(caller, func): + if not (inspect.ismethod(func) or inspect.isfunction(func)): + # skip all the fanciness, just do what works + return lambda *args, **kwargs: caller(func, *args, **kwargs) + infodict = getinfo(func) argnames = infodict['argnames'] assert not ('_call_' in argnames or '_func_' in argnames), \