- Correctly use the buffer for the else block of for loops. This caused
invalid syntax errors to be caused on 2.x and completely wrong behavior
on Python 3 (#669)
+- Resolve an issue where the `{% extends %}` tag could not be used with
+ async environments. (#668)
Version 2.9.4
-------------
self.indent()
self.writeline('if parent_template is not None:')
self.indent()
- if supports_yield_from:
+ if supports_yield_from and not self.environment.is_async:
self.writeline('yield from parent_template.'
'root_render_func(context)')
else:
- self.writeline('for event in parent_template.'
- 'root_render_func(context):')
+ self.writeline('%sfor event in parent_template.'
+ 'root_render_func(context):' %
+ (self.environment.is_async and 'async ' or ''))
self.indent()
self.writeline('yield event')
self.outdent()
'<url><loc>/bar</loc></url>',
'</urlset>',
]
+
+ def test_bare_async(self, test_env_async):
+ t = test_env_async.from_string('{% extends "header" %}')
+ assert t.render(foo=42) == '[42|23]'