[issue24252] IDLE removes elements from tracebacks.

ppperry report at bugs.python.org
Sun Jun 7 01:29:21 CEST 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue24252>
_______________________________________


More information about the Python-bugs-list mailing list