From: Armin Ronacher Date: Mon, 17 Sep 2007 13:33:45 +0000 (+0200) Subject: context doesn't convert dict subclasses to dicts now X-Git-Tag: 2.0rc1~269 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c580523a47223a7a63f3c8b51a97af3e15513cbe;p=jinja2.git context doesn't convert dict subclasses to dicts now --HG-- branch : trunk --- diff --git a/jinja/datastructure.py b/jinja/datastructure.py index 8f2069d..f4887b3 100644 --- a/jinja/datastructure.py +++ b/jinja/datastructure.py @@ -245,9 +245,12 @@ class Context(BaseContext): def __init__(self, *args, **kwargs): environment = args[0] + if not kwargs and len(args) == 2 and isinstance(args[1], dict): + base = args[1] + else: + base = dict(*args[1:], **kwargs) super(Context, self).__init__(environment.undefined_singleton, - environment.globals, - dict(*args[1:], **kwargs)) + environment.globals, base) self._translate_func = None self.cache = {} self.environment = environment