context doesn't convert dict subclasses to dicts now
authorArmin Ronacher <armin.ronacher@active-4.com>
Mon, 17 Sep 2007 13:33:45 +0000 (15:33 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Mon, 17 Sep 2007 13:33:45 +0000 (15:33 +0200)
--HG--
branch : trunk

jinja/datastructure.py

index 8f2069d7f056c282fce6ff2352cd4e8dc052426f..f4887b3de72435635fe3b9e40c7a650a8bb4aa5e 100644 (file)
@@ -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