def handle_sigint(signal, frame):
 for thread in threading.enumerate():
  if thread.isAlive():
   thread._Thread__stop()
 sys.exit(0)

def handle_sigint ( signal , frame ) : for thread in threading . enumerate ( ) : if thread . isAlive ( ) : thread . _Thread__stop ( ) sys . exit ( 0 )
attempt to kill all child threads and exit .