[svn] fixed jinja trunk
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 1 Mar 2007 19:10:04 +0000 (20:10 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Thu, 1 Mar 2007 19:10:04 +0000 (20:10 +0100)
--HG--
branch : trunk

jinja/datastructure.py
jinja/translators/python.py

index a86d0ea27864519c356b3a805a198960d40e9348..80d6b1b443d7a83686a1a99f3c2d8c0bab363739 100644 (file)
@@ -100,7 +100,7 @@ class Context(object):
 
     def __init__(self, _environment_, *args, **kwargs):
         self.environment = _environment_
-        self._stack = [self.environment.globals, dict(*args, **kwargs), {}, {}]
+        self._stack = [self.environment.globals, dict(*args, **kwargs), {}]
         self.globals, self.initial, self.current = self._stack
 
         # cache object used for filters and tests
index bb15a2db24c65b1e84b520334aea62fe94981eab..1f8e7248bf335226167169c7a029bd9ded2ee656 100644 (file)
@@ -129,8 +129,9 @@ class PythonTranslator(Translator):
 
     def process(environment, node):
         translator = PythonTranslator(environment, node)
+        filename = node.filename or '<template>'
         return Template(environment,
-                        compile(translator.translate(), node.filename, 'exec'))
+                        compile(translator.translate(), filename, 'exec'))
     process = staticmethod(process)
 
     # -- private methods