U
    i2e                     @   s@   d Z ddlZddlZddlZddlZddlZdd Zdd ZdS )z
Generate zip test data files.
    Nc              	   C   sZ   t |dD}t| D ](\}}| jt|  }||| qtj	
| W 5 Q R X |S )z9
    Zip the files in src into a new zipfile at dst.
    w)zipfileZipFilewalknamepathlibPurePosixPathas_posixwritezippCompleteDirsZinject)srcdstzfZsrc_pathreldst_name r   A/tmp/pip-unpacked-wheel-bn52x7jx/importlib_resources/tests/zip.pymake_zip_file   s    r   c              
   c   sf   t | D ]V\}}}tt |d W 5 Q R X |D ]&}t|| }|| }||fV  q8q
d S )N__pycache__)	osr   
contextlibsuppress
ValueErrorremover   Pathrelative_to)datapathdirpathdirnames	filenamesfilenameresr   r   r   r   r      s    
r   )__doc__r   r   r   r   r   r   r   r   r   r   r   <module>   s   