관리-도구
편집 파일: file_lock.cpython-38.pyc
U ,�eA � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ ejdkrld dl Z dZ ejddd d �dd��Zn d dl Z ejddd d �d d��Zejddd d�dd��ZdS )� )�annotationsN)�Callable)� Generator�win32i�� �intzCallable[[], None]zGenerator[(None, None, None)])�fileno� blocked_cb�returnc c s� zt �| t jt� W nd tk rx |� zt �| t jt� W qt tk rn } z|jtjkr^� W 5 d }~X Y q*X qtq*Y nX z d V W 5 t �| t jt� X d S �N) �msvcrtZlockingZLK_NBLCK�_region�OSErrorZLK_LOCK�errnoZ EDEADLOCKZLK_UNLCK)r r �e� r �B/opt/hc_python/lib/python3.8/site-packages/pre_commit/file_lock.py�_locked s r c c sb zt �| t jt jB � W n( tk r@ |� t �| t j� Y nX z d V W 5 t �| t j� X d S r )�fcntlZflockZLOCK_EXZLOCK_NBr ZLOCK_UN)r r r r r r 4 s �str)�pathr r c c s: t | d��&}t|�� |�� d V W 5 Q R X W 5 Q R X d S )Nza+)�openr r )r r �fr r r �lockD s r )� __future__r � contextlibr �sys�typingr r �platformr r �contextmanagerr r r r r r r �<module> s