Issues

Issue #27 resolved

<%! import foo.bar %> <% foo.bar.bazz() %> raises AttributeError

Anonymous created an issue

<%! import myapp.utils %> <% bar = myapp.utils.Sequence() %>

raises:

File "/tmp/myapp/templates/bar.html.py", line 19, in render_body bar = myapp.utils.Sequence() AttributeError: 'Undefined' object has no attribute 'utils'

looking into the compiled template:

import myapp.utils

def render_body(context,pageargs): locals = dict(pageargs=pageargs) myapp = context.get('myapp', UNDEFINED) bar = myapp.utils.Sequence() locals.update(dict([(k, locals()[k]) for k in ['bar'] if k in locals()])) return ''

i think

myapp = context.get('myapp', UNDEFINED)

should not be there...

SVN: r235

(can be worked over with the "from something import object, anotherobject" form, and sometimes "import myapp" then "import myapp.utils" solved this yesterday, but now i can't reproduce that=:)

Comments (1)

  1. Log in to comment