handling unexpected exceptions in pdb

Simon Bierbaum bierbaum at vierfalt.com
Thu Jul 10 16:21:25 CEST 2008


Hi all,

I'm in an interactive session in pdb, debugging my code using  
pdb.runcall. Somewhere, an exception is raised and lands uncaught on  
stdout. Is there any way of picking up this exception and at least  
read the full message, or even accessing its stack trace to determine  
where exactly within the one line I just executed it was raised? This  
is where I'm stuck:

 > /usr/local/apache2/bin/Model/Database.py(287)disconnect()
(Pdb) n
FlushError: FlushErr...perly.",)
 > /usr/local/apache2/bin/Model/Database.py(287)disconnect()
(Pdb) import sys
(Pdb) sys.last_traceback
*** AttributeError: 'module' object has no attribute 'last_traceback'

Thanks, Simon




More information about the Python-list mailing list