def safe(entry, *args): try: apply(entry, args) # catch everything else except: import sys #print sys.exc_type, sys.exc_value print sys.exc_info()[0], sys.exc_info()[1]