summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-08-13 08:45:41 -0400
committerTim Graham <timograham@gmail.com>2016-08-15 15:40:31 -0400
commit54771f6605147136ca954e2e3fc35ad804a89327 (patch)
tree7f54e9dbe181f5c7e4fbb8a21a566f3a4356fbb1
parent201198136da354541aed2e571168d343b55ac356 (diff)
[1.10.x] Refs #13408 -- Removed obsolete code/comments from {% for %} unpacking deprecation.
Backport of ba749f8f87dd60b20aeaefb84ee182f192746ebf from master
-rw-r--r--django/template/defaulttags.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 8923da655e..8ab1f1dbdc 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -189,10 +189,6 @@ class ForNode(Node):
if unpack:
# If there are multiple loop variables, unpack the item into
# them.
-
- # To complete this deprecation, remove from here to the
- # try/except block as well as the try/except itself,
- # leaving `unpacked_vars = ...` and the "else" statements.
if not isinstance(item, (list, tuple)):
len_item = 1
else:
@@ -203,13 +199,9 @@ class ForNode(Node):
"Need {} values to unpack in for loop; got {}. "
.format(num_loopvars, len_item),
)
- try:
- unpacked_vars = dict(zip(self.loopvars, item))
- except TypeError:
- pass
- else:
- pop_context = True
- context.update(unpacked_vars)
+ unpacked_vars = dict(zip(self.loopvars, item))
+ pop_context = True
+ context.update(unpacked_vars)
else:
context[self.loopvars[0]] = item