summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorToivo Mattila <toivo.m@hotmail.fi>2018-12-20 01:31:48 +0200
committerTim Graham <timograham@gmail.com>2018-12-19 17:31:48 -0600
commit78dc7039bc763573973475f1b9dee15afe1c470f (patch)
tree037f07e0a49e5f729403019f22164d25c8fbf3d4 /django
parent8d3147e130c4e5638fceb1e6125c040362ce12e8 (diff)
Replaced loop with dictionary comprehension.
Diffstat (limited to 'django')
-rw-r--r--django/templatetags/i18n.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py
index a1dc6e5fd4..d83c8c525d 100644
--- a/django/templatetags/i18n.py
+++ b/django/templatetags/i18n.py
@@ -127,12 +127,9 @@ class BlockTranslateNode(Node):
message_context = self.message_context.resolve(context)
else:
message_context = None
- tmp_context = {}
- for var, val in self.extra_context.items():
- tmp_context[var] = val.resolve(context)
# Update() works like a push(), so corresponding context.pop() is at
# the end of function
- context.update(tmp_context)
+ context.update({var: val.resolve(context) for var, val in self.extra_context.items()})
singular, vars = self.render_token_list(self.singular)
if self.plural and self.countervar and self.counter:
count = self.counter.resolve(context)