Skip to content
Myr

fixed deepcopy

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 0ecb859 · Browse files · 1 file+2 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−4 removed

  • other:+2 added−4 removed

1 file+2 added−4 removed

modified:jinja2/nodes.py+2 added-4 removed
118 unmodified lines
119 if isinstance(value, Node):120 new_value = value.copy()121 elif isinstance(value, list):122 new_value = []123 for item in new_value:123 for item in value:124 if isinstance(item, Node):125 item = item.copy()126 else:127 item = copy(item)128 new_value.append(item)129 else:130 new_value = copy(new_value)130 new_value = copy(value)131 setattr(result, field, new_value)132 for attr in self.attributes:133 try:134 setattr(result, attr, getattr(self, attr))
190 unmodified lines
325 constant value in the generated code, otherwise it will raise326 an `Impossible` exception."""327 from compiler import has_safe_repr328 if not has_safe_repr(value):329 if silent:330 return329 raise Impossible()330 return cls(value, lineno=lineno, environment=environment)331332
221 unmodified lines