3 ƒ”Rei ã @ sZ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZejdd„ ƒZdd„ Z dd„ Z dS )é Nc c s$ t jƒ } z | V W dtj| ƒ X dS )z2Create a temporary directory in a context manager.N)ÚtempfileÚmkdtempÚshutilÚrmtree)Útd© r úŠ/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/pep517/dirtools.pyÚtempdir s r c O sB yt j| |ŽS tk r< } z|jtjkr,‚ W Y dd}~X nX dS )zWLike `mkdir`, but does not raise an exception if the directory already exists. N)ÚosÚmkdirÚOSErrorÚerrnoÚEEXIST)ÚargsÚkwargsÚexcr r r Úmkdir_p s r c C s¢ t jƒ }tj|dƒ}xˆtj| ƒD ]z\} }}x8|D ]0}tjj| |ƒ}tjj|| ƒ}|j |d dƒ q0W x4|D ],}tjj| |ƒ}tjj|| ƒ}|j ||ƒ qjW q W |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 Zfs_pathÚrel_pathr r r Údir_to_zipfile s r&