New submission from Eric Snow: As indicated by issue #16384, the import machinery is not consistent in raising ImportError. Some places in _bootstrap.py (and _bootstrap_external.py) raise ImportError and others make no effort to wrap errors that get encountered. I would expect the import machinery to always raise ImportError, except that errors coming from executing a module to stay unwrapped.
I haven't had a chance yet to catalog the specific cases of inconsistency. Regardless, changing to be consistent would introduce backward compatibility. However, it should not be a big problem so I think we'd be okay (with an appropriate What's New entry). ---------- components: Interpreter Core messages: 274742 nosy: brett.cannon, eric.snow, ncoghlan priority: normal severity: normal stage: test needed status: open title: ImportError should be raised consistently from import machinery. type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27997> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com