
    <e                     b    d Z ddlZddlZddlZddlZd Zd Zd Zedk    o e             dS  dS )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.
    Nc                  N    d} t          t          t          |                      dS )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/...
    ...
    )0102N)tuplemapgenerate)suffixess    6/usr/lib/python3.11/test/test_importlib/update-zips.pymainr      s'     H	#h
!
!"""""    c                    t          j        t                    j                            t          j                              }|d|  dz  }t          j        |d          5 }t          |d|  z            D ]U\  }}dt          j
        |                                          z  }t          |d|           |                    ||           V	 d d d            d S # 1 swxY w Y   d S )Nzipdataz/ziptestdata.zipwdataziptestdataz->)pathlibPath__file__parentrelative_toosgetcwdzipfileZipFilewalkPurePosixPathas_posixprintwrite)suffixrootzfpathzfsrcreldsts          r
   r   r   !   s"   <!!(44RY[[AAD6f6666F		%	% TO6OO344 	 	HC'"7"G"GGC#tS!!!HHS#	                 s   !A,CC"Cc              #   :  K   t          j        |           D ]\  }}}t          j        t                    5  |                    d           d d d            n# 1 swxY w Y   |D ]4}t          j        |          |z  }|                    |           }||fV  5d S )N__pycache__)	r   r   
contextlibsuppress
ValueErrorremover   r   r   )datapathdirpathdirnames	filenamesfilenameresr%   s          r
   r   r   +   s      (*(9(9  $9 ,, 	+ 	+OOM***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+! 	 	H,w''(2C//(++Cs(NNNN	 s   AA	A	__main__)	__doc__r)   r   r   r   r   r   r   __name__ r   r
   <module>r7      s         				  # # #      	J  !4466666 ! ! !r   