def _init_atexit():
 import atexit
 import thread
 atexit.register(thread.do_terminate_threads)

def _init_atexit ( ) : import atexit import thread atexit . register ( thread . do_terminate_threads )
setup an at-exit job to be sure our workers are shutdown correctly before the interpreter quits .