Commit c9d350af authored by Julien Muchembled's avatar Julien Muchembled

jinja2: make 'import' return the leaf module instead of the root one

This is an incompatible change. For example, you would now write:

  import easy_install zc.buildout.easy_install

instead of:

  import zc zc.buildout.easy_install
parent b0810288
...@@ -74,7 +74,8 @@ EXPRESSION_HANDLER = { ...@@ -74,7 +74,8 @@ EXPRESSION_HANDLER = {
'key': getKey, 'key': getKey,
'json': (lambda expression, _, __, ___: json.loads(expression)), 'json': (lambda expression, _, __, ___: json.loads(expression)),
'jsonkey': getJsonKey, 'jsonkey': getJsonKey,
'import': (lambda expression, _, __, ___: __import__(expression)), 'import': (lambda expression, _, __, ___:
__import__(expression, fromlist=['*'], level=0)),
'section': (lambda expression, buildout, _, __: dict( 'section': (lambda expression, buildout, _, __: dict(
buildout[expression])), buildout[expression])),
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment