summaryrefslogtreecommitdiff
path: root/decorator/src/decorator.py
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2011-04-22 14:35:46 +0200
committerMichele Simionato <michele.simionato@gmail.com>2011-04-22 14:35:46 +0200
commit46545c86339e0275924aa4393f6cc519af51b777 (patch)
tree1c9c5bfc0eae2a00b1df9b35ada4f9b4ef51427a /decorator/src/decorator.py
parent1fd7a8d2869886d746501bf40329169eace4d60c (diff)
parent5092314588d6378240be7608a8cae82d5e9ff675 (diff)
downloadmicheles-46545c86339e0275924aa4393f6cc519af51b777.tar.gz
Merged from default a few bug fixes
Diffstat (limited to 'decorator/src/decorator.py')
-rw-r--r--decorator/src/decorator.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/decorator/src/decorator.py b/decorator/src/decorator.py
index d9fb01e..67e2221 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)
@@ -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__)