o
    ¹¼tf'  ã                   @   s8   d Z ddlZddlZg Zdadd„ Zdd„ Zdd	„ ZdS )
zM
asyncio aware version of atexit.

Handles SIGINT and SIGTERM, unlike atexit
é    NFc                 C   s2   t st tjt¡ t tjt¡ da t | ¡ d S )NT)Úsignal_handler_setÚsignalÚSIGINTÚ_handle_signalÚSIGTERMÚ	_handlersÚappend©Úhandler© r   ú`/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/simpervisor/atexitasync.pyÚadd_handler   s
   r   c                 C   s   t  | ¡ d S )N)r   Úremover	   r   r   r   Úremove_handler   s   r   c                 G   s:   | t jkrtjdkrt j} tD ]}|| ƒ qt d¡ d S )NÚwin32r   )r   r   ÚsysÚplatformZCTRL_C_EVENTr   Úexit)ÚsignumÚargsr
   r   r   r   r      s
   
r   )Ú__doc__r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s    	