1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #9756: the for tag no longer leaves the context stack unbalanced when dealing with an empty iterable. Thanks, seanl.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10439 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-04-07 22:02:34 +00:00
parent 4f7950ac05
commit 6d6bbb6d05
2 changed files with 13 additions and 1 deletions

View File

@@ -125,6 +125,7 @@ class ForNode(Node):
values = list(values)
len_values = len(values)
if len_values < 1:
context.pop()
return self.nodelist_empty.render(context)
nodelist = NodeList()
if self.is_reversed: