
    ytf'                     2    d Z ddlZddlZg Zdad Zd Zd Zy)zM
asyncio aware version of atexit.

Handles SIGINT and SIGTERM, unlike atexit
    NFc                     t         sRt        j                  t        j                  t               t        j                  t        j                  t               da t
        j                  |        y )NT)signal_handler_setsignalSIGINT_handle_signalSIGTERM	_handlersappendhandlers    a/var/www/html/software/conda/envs/higlass/lib/python3.12/site-packages/simpervisor/atexitasync.pyadd_handlerr      s=    fmm^4fnnn5!W    c                 .    t         j                  |        y )N)r	   remover   s    r   remove_handlerr      s    Wr   c                     | t         j                  k(  r#t        j                  dk(  rt         j                  } t
        D ]
  } ||         t        j                  d       y )Nwin32r   )r   r   sysplatformCTRL_C_EVENTr	   exit)signumargsr   s      r   r   r      sG     3<<7#:$$ HHQKr   )__doc__r   r   r	   r   r   r   r    r   r   <module>r      s,   
  
	 r   