You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In r375 there has been added a patch to allow the use of Python builtin names as template variables. I use the 'dict' builtin in several templates to make a dictionary, but with this patch the compiled template begins with the lines:
and, on render time, Python complains with an UnboundLocalError: "local variable 'dict' referenced before assignment" due to the use of dict in the _M_locals line (just before trying to pull from
the context).
Regards,
Raúl García
The text was updated successfully, but these errors were encountered:
Migrated issue, originally created by Anonymous
In r375 there has been added a patch to allow the use of Python builtin names as template variables. I use the 'dict' builtin in several templates to make a dictionary, but with this patch the compiled template begins with the lines:
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
_magic_number = 2
...
def render_body(context,**pageargs):
context.caller_stack._push_frame()
try:
__M_locals = dict(pageargs=pageargs)
dict = context.get('dict', UNDEFINED)
...
(ellipsis omitting rest of code)
and, on render time, Python complains with an UnboundLocalError: "local variable 'dict' referenced before assignment" due to the use of dict in the _M_locals line (just before trying to pull from
the context).
Regards,
Raúl García
The text was updated successfully, but these errors were encountered: