ppperry added the comment:

Is there any reason why the end of the traceback, rather then just the 
beginning, needs to be pruned in the first place?

Additionally, the "search for pdb in the tb" method will still undesirably 
prune the traceback if someone invents there own buggy debugger that subclasses 
from bdb.Bdb.

Would this cleanup function work?
def cleanup_traceback(tb):
    idle_directory = os.path.dirname(__file__)
    while os.path.dirname(tb[0][0]) == idle_directory:
        del tb[0]
    [rest of code not having to do with pruning tracebacks]
The only situation that this function would behave wrongly is when someone 
launches IDLE from the shell (Why would they do that?)

----------

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

Reply via email to