Commit 9029b4ba by Chris Jerdonek

Simplified pystache.render(): now shares code with Template.__init__().

parent 78bb39e3
......@@ -18,7 +18,4 @@ def render(template, context=None, **kwargs):
Return the given template string rendered using the given context.
"""
context = context and context.copy() or {}
context.update(kwargs)
return Template(template, context).render()
return Template(template, context, **kwargs).render()
......@@ -73,7 +73,8 @@ class Template(object):
if context is None:
context = {}
elif not isinstance(context, View):
if not isinstance(context, View):
# Views do not support copy() or update().
context = context.copy()
if kwargs:
......
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