From b797bd5c7146400447378c3b6f0dba6d2aa03c05 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Fri, 22 Apr 2011 14:06:55 +0200 Subject: Decorator 3.3.1: micro-fixes for compatibility with Python 3.2. --- decorator/src/decorator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'decorator/src/decorator.py') diff --git a/decorator/src/decorator.py b/decorator/src/decorator.py index d9fb01e..ffc8911 100644 --- a/decorator/src/decorator.py +++ b/decorator/src/decorator.py @@ -162,7 +162,7 @@ class FunctionMaker(object): @classmethod def create(cls, obj, body, evaldict, defaults=None, - doc=None, module=None, addsource=True,**attrs): + doc=None, module=None, addsource=True, **attrs): """ Create a function from the strings name, signature and body. evaldict is the evaluation dictionary. If addsource is true an attribute @@ -193,7 +193,7 @@ def decorator(caller, func=None): evaldict['_func_'] = func return FunctionMaker.create( func, "return _call_(_func_, %(shortsignature)s)", - evaldict, undecorated=func) + evaldict, undecorated=func, __wrapped__=func) else: # returns a decorator if isinstance(caller, partial): return partial(decorator, caller) -- cgit v1.2.1 From 5092314588d6378240be7608a8cae82d5e9ff675 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Fri, 22 Apr 2011 14:32:15 +0200 Subject: Added __wrapped__ even to the high level usage of decorator --- decorator/src/decorator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'decorator/src/decorator.py') diff --git a/decorator/src/decorator.py b/decorator/src/decorator.py index ffc8911..67e2221 100644 --- a/decorator/src/decorator.py +++ b/decorator/src/decorator.py @@ -205,5 +205,5 @@ def decorator(caller, func=None): return FunctionMaker.create( '%s(%s)' % (caller.__name__, first), 'return decorator(_call_, %s)' % first, - evaldict, undecorated=caller, + evaldict, undecorated=caller, __wrapped__=caller, doc=caller.__doc__, module=caller.__module__) -- cgit v1.2.1