diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-19 03:55:12 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-19 03:55:12 +0000 |
commit | 23dd29f0c9b4c27e82648cc02fe834052ef05f1c (patch) | |
tree | 20441f1815dfdc4e34f9c63e9d7a554ebab0ec5a /lib/mako/codegen.py | |
parent | 22194b40ce386a99d3439482d2c7ec7f3a7236e6 (diff) | |
download | external_python_mako-23dd29f0c9b4c27e82648cc02fe834052ef05f1c.tar.gz external_python_mako-23dd29f0c9b4c27e82648cc02fe834052ef05f1c.tar.bz2 external_python_mako-23dd29f0c9b4c27e82648cc02fe834052ef05f1c.zip |
- improvement to scoping of "caller" variable when using <%call> tag
Diffstat (limited to 'lib/mako/codegen.py')
-rw-r--r-- | lib/mako/codegen.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mako/codegen.py b/lib/mako/codegen.py index 477ccad..285e392 100644 --- a/lib/mako/codegen.py +++ b/lib/mako/codegen.py @@ -523,14 +523,15 @@ class _GenerateRenderMethod(object): self.printer.writelines( # push on global "caller" to be picked up by the next ccall - "context.caller_stack.append(runtime.Namespace('caller', context, callables=ccall(context.caller_stack[-1])))", + "caller = context['caller']._get_actual_caller()", + "context.push_caller(runtime.Namespace('caller', context, callables=ccall(runtime._StackFacade(context, caller))))", "try:") self.write_source_comment(node) self.printer.writelines( "context.write(unicode(%s))" % node.attributes['expr'], "finally:", # pop it off - "context.caller_stack.pop()", + "context.pop_caller()", None ) |