관리-도구
편집 파일: dirtools.cpython-311.pyc
� �Rei � �j � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZej d� � � Zd� Z d� Z dS )� Nc # � K � t j � � } | V � t j | � � dS # t j | � � w xY w)z2Create a temporary directory in a context manager.N)�tempfile�mkdtemp�shutil�rmtree)�tds ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/pep517/dirtools.py�tempdirr sP � � � � � � � �B������� �b�������� �b�������s �1 �Ac � � t j | i |��S # t $ r!}|j t j k r� Y d}~dS d}~ww xY w)zWLike `mkdir`, but does not raise an exception if the directory already exists. N)�os�mkdir�OSError�errno�EEXIST)�args�kwargs�excs r �mkdir_pr sa � ���x��(��(�(�(��� � � ��9���$�$�� %�$�$�$�$�$��������s � � >�9�>c � � t j � � }t j |d� � }t j | � � D ]�\ } }}|D ][}t j � | |� � }t j � || � � }|� |dz d� � �\|D ]X}t j � | |� � }t j � || � � }|� ||� � �Y��|S )z0Construct an in-memory zip file for a directory.�w�/� )�io�BytesIO�zipfile�ZipFiler �walk�path�join�relpath�writestr�write)�root�buffer�zip_file�dirs�filesr �fs_path�rel_paths r �dir_to_zipfiler* s� � � �Z�\�\�F���v�s�+�+�H��W�T�]�]� .� .���d�E�� 2� 2�D��g�l�l�4��.�.�G��w���w��5�5�H����h��n�b�1�1�1�1�� .� .�D��g�l�l�4��.�.�G��w���w��5�5�H��N�N�7�H�-�-�-�-� .� �O� )r r � contextlibr r r r �contextmanagerr r r* � r+ r �<module>r/ s� �� � � � � � � � � � � � � ���� � � � � ���� ���� ��� � ���� � � � � � � r+