Meador Inge <mead...@gmail.com> added the comment:

> So doing the import manually through __import__('os', globals(), 
> locals(), ['walk'], 1) does not work. 

I get the same behavior for this reproduction case regardless of whether I use:
   import .os import walk
or:
   __import__('os', globals(), locals(), ['walk'], 1)
The bug is reproducible in the trunk.

I think the problem has to do with 'import_module_level' incorrectly doing an 
absolute lookup for 'os' when the relative lookup in 'foo' fails.  I have 
attached a patch with the relevant fix and test case.

----------
keywords: +patch
nosy: +minge
Added file: http://bugs.python.org/file16350/issue-7902.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to