Georg Brandl <ge...@python.org> added the comment:

I agree that this is not helpful at all in the usual case, i.e. when you 
*don't* want to debug importlib.  The one frame in actual user code (distutils 
in this case) in the middle is kind of hard to spot, but it is what you want to 
know.  Note that Amaury's example is quite small; in other projects the import 
chains may go on for 10-20 modules until the ImportError is raised.  Good luck 
finding out where the bad module was imported without cursing.

This is different from the normal case in user code calling stdlib code, which 
raises an exception: the user code frames will be near the top, and the stdlib 
code near the bottom.

I see several options here, in no particular order of preference:

1. special-case importlib._bootstrap when printing tracebacks
2. rewrite the traceback object when raising ImportErrors from importlib
5. (is there more?)

----------
assignee:  -> brett.cannon
nosy: +georg.brandl
priority: normal -> critical

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

Reply via email to