Minimising stack trace

Cecil Westerhof Cecil at decebal.nl
Sat May 16 09:49:42 EDT 2015


Op Friday 15 May 2015 20:17 CEST schreef Cecil Westerhof:

> While playing with recursion I get:
> RuntimeError: maximum recursion depth exceeded in comparison
>
> But then I get a very long stack trace. Is there a way to make this
> a lot shorter. Now I ‘lose’ interesting information because of the
> length of the stack trace.

I found something. I could use:
    import sys

    sys.tracebacklimit = 10

The output is different, but I find it useful enough.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list