Chris Jerdonek added the comment: >> from foo import bar >> Here bar can be not module, but an attribute of foo (for example, os.path). > Serhiy: What exception is raised in that situation is controlled by the eval > loop, not importlib so that would be a separate change.
Just to clarify from this exchange, is there a chance we will use this same exception type (perhaps in a later change) in cases where bar is not found? If so, I think it's worth considering something like "NotFoundImportError" or "ImportNotFoundError" that doesn't single out module. Importing classes, etc. is quite a common pattern (e.g. examples appear in PEP 8). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15767> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com