diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 921a359..f1820c8 100644
a
|
b
|
from django.template.base import (Node, NodeList, Template, Context, Library,
|
16 | 16 | render_value_in_context) |
17 | 17 | from django.template.smartif import IfParser, Literal |
18 | 18 | from django.template.defaultfilters import date |
19 | | from django.utils.encoding import smart_text |
| 19 | from django.utils.encoding import smart_text, force_unicode |
20 | 20 | from django.utils.safestring import mark_safe |
21 | 21 | from django.utils.html import format_html |
22 | 22 | from django.utils import six |
… |
… |
class ForNode(Node):
|
154 | 154 | len_values = len(values) |
155 | 155 | if len_values < 1: |
156 | 156 | return self.nodelist_empty.render(context) |
157 | | nodelist = NodeList() |
| 157 | nodelist = [] |
158 | 158 | if self.is_reversed: |
159 | 159 | values = reversed(values) |
160 | 160 | unpack = len(self.loopvars) > 1 |
… |
… |
class ForNode(Node):
|
205 | 205 | # don't want to leave any vars from the previous loop on the |
206 | 206 | # context. |
207 | 207 | context.pop() |
208 | | return nodelist.render(context) |
| 208 | return mark_safe(''.join([force_unicode(n) for n in nodelist])) |
209 | 209 | |
210 | 210 | class IfChangedNode(Node): |
211 | 211 | child_nodelists = ('nodelist_true', 'nodelist_false') |