Nick Coghlan added the comment:

Ah, it turns out the three problem children are those which accept an "import_" 
callback, which is set to builtins.__import__ when accessed via the import 
statement. This means we end up making a *recursive* call to 
PyImport_ImportModuleLevelObject, which calls remove_importlib_frames. The 
inner section of the trace gets stripped away, thus the "_exec_module" frame is 
already gone by the time the outer frames get added to the traceback.

For the moment, I'm just going to adopt the blunt instrument approach and 
special case those three functions (including them in the "always strip" 
category). If anyone else comes up with a more elegant mechanism to deal with 
the recursion, we can switch to it later.

----------

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

Reply via email to