howto catch an Exception and still print the TraceBack?

Saizan sanzhiyan at gmail.com
Wed Feb 1 03:34:03 EST 2006


In an event-driven application i'd like to keep the program alive regardless of any exceptions raised by the handlers,
but still be able to debug them by reading the appropriate TraceBack from stderr.
I can put something like:

try:
	self.call_handler(handler,*args)
except Exception, e:
	print e
	print e.args

in the dispatcher, but that isn't as helpful as a complete TraceBack.



More information about the Python-list mailing list