def install_thread_excepthook():
 import sys
 run_old = Thread.run
 def run(*args, **kwargs):
  try:
   run_old(*args, **kwargs)
  except (KeyboardInterrupt, SystemExit):
   raise
  except:
   sys.excepthook(*sys.exc_info())
 Thread.run = run

def install_thread_excepthook ( ) : import sys run_old = Thread . run def run ( * args , ** kwargs ) : try : run_old ( * args , ** kwargs ) except ( KeyboardInterrupt , SystemExit ) : raise except : sys . excepthook ( * sys . exc_info ( ) ) Thread . run = run
workaround for sys .