summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/decorator.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decorator.py b/src/decorator.py
index 05f7056..a8c22e7 100644
--- a/src/decorator.py
+++ b/src/decorator.py
@@ -225,9 +225,7 @@ def decorate(func, caller):
"""
decorate(func, caller) decorates a function using a caller.
"""
- evaldict = func.__globals__.copy()
- evaldict['_call_'] = caller
- evaldict['_func_'] = func
+ evaldict = dict(_call_=caller, _func_=func)
fun = FunctionMaker.create(
func, "return _call_(_func_, %(shortsignature)s)",
evaldict, __wrapped__=func)
@@ -258,9 +256,7 @@ def decorator(caller, _func=None):
name = caller.__class__.__name__.lower()
callerfunc = caller.__call__.__func__
doc = caller.__call__.__doc__
- evaldict = callerfunc.__globals__.copy()
- evaldict['_call_'] = caller
- evaldict['_decorate_'] = decorate
+ evaldict = dict(_call_=caller, _decorate_=decorate)
return FunctionMaker.create(
'%s(func)' % name, 'return _decorate_(func, _call_)',
evaldict, doc=doc, module=caller.__module__,