When compiled with -Xcheetah-cheats (or when options.cheetah_cheats
is True) and no optimizations are applied, the template source
#set $a = 'foo'
#set $b = $a
produces the template code
_self_search_list = self.search_list + [_globals]
a = u'foo'
b = resolve_placeholder(_self_search_list, 'a')
which causes a runtime error.
Fix this by adding locals() to the search list during
placeholder resolution. Also fix a bug where a runtime error
occurs if self.search_list is None by conditionally adding
it to the search list. After, the template code is
if self.search_list:
_self_search_list = self.search_list + [_globals]
else:
_self_search_list = [_globals]
a = u'foo'
b = resolve_placeholder([locals()] + _self_search_list, 'a')
When compiled with
-Xcheetah-cheats
(or whenoptions.cheetah_cheats
isTrue
) and no optimizations are applied, the template sourceproduces the template code
which causes a runtime error.
Fix this by adding
locals()
to the search list during placeholder resolution. Also fix a bug where a runtime error occurs ifself.search_list
isNone
by conditionally adding it to the search list. After, the template code isCloses #6