@contextmanager
def hard_exit_handler():
 try:
  (yield)
 except HardSystemExit:
  os._exit(0)

@ contextmanager def hard_exit_handler ( ) : try : ( yield ) except HardSystemExit : os . _exit ( 0 )
an exit helper for the daemon/forkd context that provides for deferred os .