Your IP : 216.73.216.213


Current Path : /opt/alt/python310/lib64/python3.10/test/test_importlib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/test_importlib/__pycache__/update-zips.cpython-310.pyc

o

0�i��@sTdZddlZddlZddlZddlZdd�Zdd�Zdd�Zed	ko'e�dSdS)
z�
Generate the zip test data files.

Run to build the tests/zipdataNN/ziptestdata.zip files from
files in tests/dataNN.

Replaces the file with the working copy, but does commit anything
to the source repo.
�NcCsd}ttt|��dS)a;
    >>> from unittest import mock
    >>> monkeypatch = getfixture('monkeypatch')
    >>> monkeypatch.setattr(zipfile, 'ZipFile', mock.MagicMock())
    >>> print(); main()  # print workaround for bpo-32509
    <BLANKLINE>
    ...data01... -> ziptestdata/...
    ...
    ...data02... -> ziptestdata/...
    ...
    )Z01Z02N)�tuple�map�generate)�suffixes�r�F/opt/alt/python310/lib64/python3.10/test/test_importlib/update-zips.py�mainsrcCs�t�t�j�t���}|d|�d�}t�|d��,}t	|d|���D]\}}dt�
|���}t|d|�|�
||�q#Wd�dS1sHwYdS)NZzipdataz/ziptestdata.zip�w�dataZziptestdataz->)�pathlib�Path�__file__�parent�relative_to�os�getcwd�zipfileZZipFile�walkZ
PurePosixPathZas_posix�print�write)�suffix�rootZzfpathZzf�src�relZdstrrrr!s�"�rc	cs|�t�|�D]5\}}}t�t��
|�d�Wd�n1s wY|D]}t�|�|}|�|�}||fVq'qdS)N�__pycache__)	rr�
contextlib�suppress�KeyError�removerrr)�datapath�dirpathZdirnames�	filenames�filename�resrrrrr+s��
��r�__main__)	�__doc__rrrrrrr�__name__rrrr�<module>s