
    wi/	                        d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ ej        dk    rd dl	Z	dZ
ej        dd            Znd dlZej        dd            Zej        dd            ZdS )    )annotationsN)Callable)	Generatorwin32i  filenoint
blocked_cbCallable[[], None]returnGenerator[None]c              #    K   	 t          j        | t           j        t                     np# t          $ rc  |             	 	 t          j        | t           j        t                     n.# t          $ r }|j        t          j        k    r Y d }~nd }~ww xY wUY nw xY w	 d V  t          j        | t           j        t                     d S # t          j        | t           j        t                     w xY wN)	msvcrtlockingLK_NBLCK_regionOSErrorLK_LOCKerrno	EDEADLOCKLK_UNLCK)r   r	   es      d/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/pre_commit/file_lock.py_lockedr      s	     
	N66?G<<<< 	 	 	JLLL
	N66>7CCC      w%/11 21111	
 E		=EEE N66?G<<<<<FN66?G<<<<sE   %* B %A&%B&
B0BBBBBC 'C-c              #  h  K   	 t          j        | t           j        t           j        z             n9# t          $ r,  |             t          j        | t           j                   Y nw xY w	 d V  t          j        | t           j                   d S # t          j        | t           j                   w xY wr   )fcntlflockLOCK_EXLOCK_NBr   LOCK_UN)r   r	   s     r   r   r   4   s      
	/K =>>>> 	/ 	/ 	/JLLLK.....	/	/EEEK.....EK....s   ,1 3A'&A'+B !B1pathstrc              #     K   t          | d          5 }t          |                                |          5  d V  d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nza+)openr   r   )r!   r	   fs      r   lockr&   D   s      
 
dD		 QQXXZZ,, 	 	EEE	 	 	 	 	 	 	 	 	 	 	 	 	 	 	                 s3   #AAAA	AA	AA#&A#)r   r   r	   r
   r   r   )r!   r"   r	   r
   r   r   )
__future__r   
contextlibr   syscollections.abcr   r   platformr   r   contextmanagerr   r   r&        r   <module>r/      s    " " " " " "      



 $ $ $ $ $ $ % % % % % % <7MMM G= = = = =< LLL/ / / /      r.   