2011/6/17 Massimo Di Pierro <[email protected]>

> uploading your fix to trunk.
>
> On Jun 17, 8:50 am, amit <[email protected]> wrote:
> > I am getting the same import error as the OP. The problem occurs when
> > an external module calls __import__ but has passed globals=None. The
> > following patch in gluon/custom_import.py fixes it for me, since in
> > this case, web2py does not need to perform any customized import.
> >
>
> > 255c255
> > <                 and not name.startswith("applications."):
> > ---
> >
> > >                 and not name.startswith("applications.") and not
> globals==None:
> >
>

Exact. I prefer "and isinstance(globals, dict)" to "not globals==None".

Note that this patch means that the "modules" directory not be searched in
that case.
-- 


A+

-------------
Pierre
My blog and profile
(http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
YouTube page 
(http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>

Reply via email to