Commit 984e5f5c by Chris Jerdonek

Template.render() no longer creates new Template instances while rendering.

parent 73f3d72f
...@@ -278,11 +278,7 @@ class Template(object): ...@@ -278,11 +278,7 @@ class Template(object):
def _render_dictionary(self, template, context): def _render_dictionary(self, template, context):
self.context.push(context) self.context.push(context)
out = self._render(template)
template = Template(template, load_template=self.load_template, escape=self.escape,
default_encoding=self.default_encoding, decode_errors=self.decode_errors)
out = template.render(self.context)
self.context.pop() self.context.pop()
return out return out
...@@ -331,9 +327,7 @@ class Template(object): ...@@ -331,9 +327,7 @@ class Template(object):
@modifiers.set('>') @modifiers.set('>')
def _render_partial(self, template_name): def _render_partial(self, template_name):
markup = self.load_template(template_name) markup = self.load_template(template_name)
template = Template(markup, load_template=self.load_template, escape=self.escape, return self._render(markup)
default_encoding=self.default_encoding, decode_errors=self.decode_errors)
return template.render(self.context)
@modifiers.set('=') @modifiers.set('=')
def _change_delimiter(self, tag_name): def _change_delimiter(self, tag_name):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment