how to print a traceback?

S

sndive

i'm struggling to get some proxy code working with liburl[2] and want
to print
some tracebacks in my class ProxyHTTPConnection::request().
do i have to force an exception and print a backtrace in catch or
can i just print the current stack?
print_tb takes an argument and short of forcing an exception
i don;t know where to get the current backtrace object from.

thanks.
 
G

Gabriel Genellina

i'm struggling to get some proxy code working with liburl[2] and want
to print
some tracebacks in my class ProxyHTTPConnection::request().
do i have to force an exception and print a backtrace in catch or
can i just print the current stack?
print_tb takes an argument and short of forcing an exception
i don;t know where to get the current backtrace object from.

from traceback import print_stack
print_stack()
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top