
    e                    V    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e	      Zy)    )annotationsN   )MesonException)BuildDirLockr   c                      e Zd ZddZddZy)r   c                *   t        | j                  dd      | _        	 t        j                  | j                  j                         t        j                  d       y # t        t        f$ r& | j                  j                          t        d      w xY w)Nwzutf-8)encodingr   zHSome other Meson process is already using this build directory. Exiting.)openlockfilenamelockfilemsvcrtlockingfilenoLK_NBLCKBlockingIOErrorPermissionErrorcloser   )selfs    8/usr/lib/python3/dist-packages/mesonbuild/utils/win32.py	__enter__zBuildDirLock.__enter__   sq    T..gF	mNN4==//16??AF1 	mMM! !kll	ms   =A 5Bc                    t        j                  | j                  j                         t         j                  d       | j                  j                          y )Nr   )r   r   r   r   LK_UNLCKr   )r   argss     r   __exit__zBuildDirLock.__exit__&   s3    t}}++-vB    N)returnNone)r   zT.Anyr   r   )__name__
__module____qualname__r   r    r   r   r   r      s    mr   )
__future__r   r   typingTcorer   platformr   BuildDirLockBase__all__r"   r   r   <module>r*      s.     # A     6
# r   