Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`extends` keyword not working in async mode #668

mohd-akram opened this issue Jan 22, 2017 · 0 comments


Copy link

commented Jan 22, 2017

Expected Behavior

The extends keyword should work in async mode.

Actual Behavior

This error happens: SyntaxError: 'yield from' inside async function.

Template Code

{% extends 'base.html' %}

Full Traceback

Exception occurred while handling uri: "/1"
Traceback (most recent call last):
  File "/Users/mohamed/.virtualenvs/", line 208, in handle_request
    response = await response
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/", line 109, in __next__
    return self.gen.send(None)
  File "", line 88, in item
    description=' | '.join(desc_list))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/", line 109, in __next__
    return self.gen.send(None)
  File "", line 307, in render
    template = jinja_env.get_template(template)
  File "/Users/mohamed/.virtualenvs/", line 833, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/Users/mohamed/.virtualenvs/", line 807, in _load_template
    template = self.loader.load(self, name, globals)
  File "/Users/mohamed/.virtualenvs/", line 125, in load
    code = environment.compile(source, name, filename)
  File "/Users/mohamed/.virtualenvs/", line 590, in compile
    return self._compile(source, filename)
  File "/Users/mohamed/.virtualenvs/", line 552, in _compile
    return compile(source, filename, 'exec')
  File "templates/item.html", line 15
SyntaxError: 'yield from' inside async function

Your Environment

  • Python version: 3.6
  • Jinja version: 2.9.4

@davidism davidism added the bug label Jan 24, 2017

@mitsuhiko mitsuhiko closed this in 8df94bd Jan 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.