Nick Coghlan added the comment:

Somewhat related issues are issue 16217 (traceback noise when running under 
python -m) and issue 23773 (traceback noise when running under custom import 
hooks)

For 3.4 and 3.5, we may want to consider a brute force solution where the 
warnings module just straight up ignores _frozen_importlib frames when counting 
stack levels.

For 3.6+, I've occasionally pondered various ideas for introducing the notion 
of a "frame debugging level". The most recent variant of that idea would be to 
have all frames live in level zero by default, but there'd be a way to flag a 
module at compile time to set it higher for the code objects created by that 
module.

Displaying those frames in tracebacks would then be tied to both the current 
frame's debugging level and the interpreter's verbosity level (whichever was 
higher), while other stack related operations (like the warnings stacklevel and 
frame retrieval) would only consider frames at the current frame's debugging 
level and below.

----------

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

Reply via email to