How to increase the depth of the python traceback?

M

Milton

How to increase the depth of the python traceback?

I have some code that gets an exception deep in the python logging
module and the traceback produced does not go back far enough to show
my own code. How can the traceback limit be controlled in Python 2.5.

The docs indicate that there is an attribute in the sys module
“tracebacklimit” that defaults to 1000 (affectively no limit). I
cannot find this attribute in the sys module of Python2.5
 
P

Peter Otten

Milton said:
How to increase the depth of the python traceback?

I have some code that gets an exception deep in the python logging
module and the traceback produced does not go back far enough to show
my own code. How can the traceback limit be controlled in Python 2.5.

The docs indicate that there is an attribute in the sys module
“tracebacklimit†that defaults to 1000 (affectively no limit). I
cannot find this attribute in the sys module of Python2.5

Just set it yourself:
Traceback (most recent call last):
.... if n: bomb(n-1)
.... else: 1/0
....Traceback (most recent call last):
File "<stdin>", line 2, in bomb
File "<stdin>", line 2, in bomb
File "<stdin>", line 3, in bomb
ZeroDivisionError: integer division or modulo by zero

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top