def _turn_sigterm_into_systemexit():
 try:
  import signal
 except ImportError:
  return
 def handle_term(signo, frame):
  raise SystemExit
 signal.signal(signal.SIGTERM, handle_term)

def _turn_sigterm_into_systemexit ( ) : try : import signal except ImportError : return def handle_term ( signo , frame ) : raise SystemExit signal . signal ( signal . SIGTERM , handle_term )
attempts to turn a sigterm exception into a systemexit exception .