fixed deepcopy
authorArmin Ronacher <armin.ronacher@active-4.com>
Wed, 9 Apr 2008 14:31:20 +0000 (16:31 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Wed, 9 Apr 2008 14:31:20 +0000 (16:31 +0200)
--HG--
branch : trunk

jinja2/nodes.py

index 911f9fc0dc5223f7847f62d528b93d8a7abecbe7..00f6d62cfe2bf0b6e0e51351e4ad65d78d945b05 100644 (file)
@@ -120,14 +120,14 @@ class Node(object):
                 new_value = value.copy()
             elif isinstance(value, list):
                 new_value = []
-                for item in new_value:
+                for item in value:
                     if isinstance(item, Node):
                         item = item.copy()
                     else:
                         item = copy(item)
                     new_value.append(item)
             else:
-                new_value = copy(new_value)
+                new_value = copy(value)
             setattr(result, field, new_value)
         for attr in self.attributes:
             try:
@@ -326,8 +326,6 @@ class Const(Literal):
         an `Impossible` exception."""
         from compiler import has_safe_repr
         if not has_safe_repr(value):
-            if silent:
-                return
             raise Impossible()
         return cls(value, lineno=lineno, environment=environment)