import traceback try: raise ValueError except: tb = traceback.format_exc() else: tb = "No error" finally: print tb
Original: http://stackoverflow.com/questions/4564559/get-exception-description-and-stack-trace-which-caused-an-exception-all-as-a-st
import traceback try: raise ValueError except: tb = traceback.format_exc() else: tb = "No error" finally: print tb
Original: http://stackoverflow.com/questions/4564559/get-exception-description-and-stack-trace-which-caused-an-exception-all-as-a-st