Commit a68ddb39 by Chris Jerdonek

Simplified the logic in Template.__init__() slightly.

parent 236d7d46
...@@ -77,10 +77,12 @@ class Template(object): ...@@ -77,10 +77,12 @@ class Template(object):
if not isinstance(context, View): if not isinstance(context, View):
# Views do not support copy() or update(). # Views do not support copy() or update().
context = context.copy() context = context.copy()
if kwargs: view = View(context=context, **kwargs)
context.update(kwargs) else:
view = context
self.view = view
self.view = context if isinstance(context, View) else View(context=context)
self._compile_regexps() self._compile_regexps()
def _compile_regexps(self): def _compile_regexps(self):
......
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