Éric Araujo added the comment:

Fix is simple:

--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1519,7 +1519,7 @@ def _find_and_load_unlocked(name, import
             path = parent_module.__path__
         except AttributeError:
             msg = (_ERR_MSG + '; {} is not a package').format(name, parent)
-            raise ImportError(msg, name=name)
+            raise ImportError(msg, name=name) from None

Manual testing confirms the fix.  Is a unit test needed?  Should this wait for 
3.5?

----------
nosy: +eric.araujo

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

Reply via email to