Brett Cannon <br...@python.org> added the comment:

That "cannot import name" message seems to only come from 
Python/ceval.c:import_from() which raises that exception when an AttributeError 
is raised by an 'import from' statement (I think). This happens when an 'import 
from' asks for a name on the package/module that doesn't exist.

Looking at importlib, I found the code that captures the ImportErrorof a 
submodule, which allows the import to continue and then fail as an 
AttributeError at the bytecode level. I'm running the test suite now with that 
try/except removed to see if this was just a mis-interpretation on my part of 
how to handle this situation. As of right now the only failures I have continue 
my belief that import * is evil.

----------

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

Reply via email to