o
    e                     @  sP   d dl mZ 	 d dlZd dlZddlmZ ddlmZ	 dgZ
G dd de	ZdS )    )annotationsN   )MesonException)BuildDirLockr   c                   @  s    e Zd Zd
ddZdddZd	S )r   returnNonec              	   C  sT   t | jddd| _zt| j tjd W d S  ttfy)   | j	  t
dw )Nwzutf-8)encodingr   zHSome other Meson process is already using this build directory. Exiting.)openZlockfilenamelockfilemsvcrtlockingfilenoZLK_NBLCKBlockingIOErrorPermissionErrorcloser   )self r   ;/usr/lib/python3.10/site-packages/mesonbuild/utils/win32.py	__enter__   s   
zBuildDirLock.__enter__argsT.Anyc                 G  s$   t | j t jd | j  d S )Nr   )r   r   r   r   ZLK_UNLCKr   )r   r   r   r   r   __exit__&   s   zBuildDirLock.__exit__N)r   r   )r   r   r   r   )__name__
__module____qualname__r   r   r   r   r   r   r      s    
)
__future__r   r   typingTcorer   platformr   ZBuildDirLockBase__all__r   r   r   r   <module>   s   