Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_importlib/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_importlib/__pycache__/test_util.cpython-312.opt-2.pyc

�

)Μg�}���ddlmZejd�Zejd�Zejd�Zejd�ZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlZddlZddlZddlZddlZ	ddlZ	ddlZ	ddlZGd�d	�Zej8ee��\ZZGd
�d�Zej8eeee��\Z Z!Gd
�d�Z"ej8e"e��\Z#Z$Gd�d�Z%ej8e%eee��\Z&Z'Gd�d�Z(ej8e(e��\Z)Z*Gd�d�Z+ej8e+e��\Z,Z-Gd�dej\�Z(ej^edud�Gd�dej\��Z0e1dk(rejd�yy#e$rdZY��8wxYw#e$rdZY��AwxYw#e$rdZY��JwxYw)�)�utilz
importlib.abc�	importlibzimportlib.machineryzimportlib.utilN)�supportc�"�eZdZdZd�Zd�Zd�Zy)�DecodeSourceBytesTestsustring ='ü'c��|jjd�}|j|jj	|�|j�y)N�utf-8��source�encode�assertEqualr�
decode_source)�self�source_bytess  �:/usr/local/lib/python3.12/test/test_importlib/test_util.py�test_ut8_defaultz'DecodeSourceBytesTests.test_ut8_default's9���{�{�)�)�'�2��������0�0��>����L�c��d|jz}|jd�}|j|jj	|�|�y)Nz# coding=latin-1
zlatin-1r
�rrrs   r�test_specified_encodingz.DecodeSourceBytesTests.test_specified_encoding+s=��%����3���}�}�Y�/��������0�0��>��Grc��dj|j|jg�}|jd�}|j|jj|�dj|j|jg��y)Nz
r	�
)�joinrrr
rrrs   r�test_universal_newlinesz.DecodeSourceBytesTests.test_universal_newlines1sd�����d�k�k�4�;�;�7�8���}�}�W�-��������0�0��>����D�K�K����#=�>�	@rN)�__name__�
__module__�__qualname__rrrr�rrrr#s��
�F�M�H�@rrc�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�ModuleFromSpecTestsc���Gd�d�}|jjd|��}|jt�5|jj|�}ddd�y#1swYyxYw)Nc��eZdZd�Zy)�9ModuleFromSpecTests.test_no_create_module.<locals>.Loaderc��y�Nr)r�modules  r�exec_modulezEModuleFromSpecTests.test_no_create_module.<locals>.Loader.exec_moduleAs��rN)rrrr'rrr�Loaderr#@s��
rr(�test)�	machinery�
ModuleSpec�assertRaises�ImportErrorr�module_from_spec�rr(�specr&s    r�test_no_create_modulez)ModuleFromSpecTests.test_no_create_module?sT��	�	��~�~�(�(����:��
�
�
�{�
+��Y�Y�/�/��5�F�,�
+�
+�s�A&�&A/c�F�Gd�d|jj�}|jjd|��}|jj|�}|j
|tj�|j|j|j�y)Nc��eZdZd�Zy)�CModuleFromSpecTests.test_create_module_returns_None.<locals>.Loaderc��yr%r)rr0s  r�
create_modulezQModuleFromSpecTests.test_create_module_returns_None.<locals>.Loader.create_moduleIs��rN�rrrr6rrrr(r4Hs��
rr(r))�abcr(r*r+rr.�assertIsInstance�types�
ModuleTyper
r�namer/s    r�test_create_module_returns_Nonez3ModuleFromSpecTests.test_create_module_returns_NoneGsr��	�T�X�X�_�_�	��~�~�(�(����:�����+�+�D�1�����f�e�&6�&6�7�������$�)�)�4rc�V���d�Gd�dtj��G��fd�d|jj�}|jjd|��}|jj|�}|j|��|j|j��y)Nzalready setc��eZdZy)�<ModuleFromSpecTests.test_create_module.<locals>.CustomModuleN)rrrrrr�CustomModuler@Rs��rrAc���eZdZ��fd�Zy)�6ModuleFromSpecTests.test_create_module.<locals>.Loaderc�:���|j�}�|_|Sr%)r<r)rr0r&rAr<s   ��rr6zDModuleFromSpecTests.test_create_module.<locals>.Loader.create_moduleUs���%�d�i�i�0��"&����
rNr7)rAr<s��rr(rCTs���
rr(r))r:r;r8r(r*r+rr.r9r
r)rr(r0r&rAr<s    @@r�test_create_modulez&ModuleFromSpecTests.test_create_modulePs������	�5�+�+�	�	�T�X�X�_�_�	�
�~�~�(�(����:�����+�+�D�1�����f�l�3�������$�/rc���|jjdt��}|jj	|�}|j|j|j�y�Nr))r*r+�objectrr.r
rr<�rr0r&s   r�
test___name__z!ModuleFromSpecTests.test___name__^sF���~�~�(�(����:�����+�+�D�1��������$�)�)�4rc��|jjdt��}|jj	|�}|j|j|�yrG)r*r+rHrr.r
�__spec__rIs   r�
test___spec__z!ModuleFromSpecTests.test___spec__csB���~�~�(�(����:�����+�+�D�1��������$�/rc��t�}|jjd|�}|jj	|�}|j|j|�yrG)rHr*r+rr.�assertIs�
__loader__)r�loaderr0r&s    r�test___loader__z#ModuleFromSpecTests.test___loader__hsG������~�~�(�(���8�����+�+�D�1���
�
�f�'�'��0rc���|jjdt��}|jj	|�}|j|j|j�y)Nztest.pkg)r*r+rHrr.r
�__package__�parentrIs   r�test___package__z$ModuleFromSpecTests.test___package__nsH���~�~�(�(��V�X�>�����+�+�D�1������+�+�T�[�[�9rc���|jjdt�d��}|jj	|�}|j|j|j�y)Nr)T)�
is_package)r*r+rHrr.r
�__path__�submodule_search_locationsrIs   r�
test___path__z!ModuleFromSpecTests.test___path__ssM���~�~�(�(����d�(�K�����+�+�D�1��������$�*I�*I�Jrc���|jjdt�d��}d|_|jj|�}|j
|j|j�y)Nr)�	some/path)�originT)	r*r+rH�has_locationrr.r
�__file__r^rIs   r�
test___file__z!ModuleFromSpecTests.test___file__xsS���~�~�(�(����+�(�N�� ������+�+�D�1��������$�+�+�6rc���|jjdt��}d|_d|_|j
j
|�}|j|j|j�y)Nr)r]T)	r*r+rH�cachedr_rr.r
�
__cached__rIs   r�test___cached__z#ModuleFromSpecTests.test___cached__~sW���~�~�(�(����:��!��� ������+�+�D�1������*�*�D�K�K�8rN)
rrrr1r=rErJrMrRrVr[rarerrrr r =s5��6�5�0�5�
0�
1�:�
K�
7�9rr )r8r*rc�2�eZdZ	d�Zd�Zd�Zd�Zd�Zd�Zy)�ResolveNameTestsc�\�|jd|jjdd��y)N�bacon�r
r�resolve_name�rs r�
test_absolutezResolveNameTests.test_absolute�s#������$�)�)�"8�"8��$�"G�Hrc�\�|jd|jjdd��y)Nri�spamrjrls r�test_absolute_within_packagez-ResolveNameTests.test_absolute_within_package�s#������$�)�)�"8�"8��&�"I�Jrc��|jt�5|jjdd�ddd�y#1swYyxYw)N�.bacon��r,r-rrkrls r�test_no_packagez ResolveNameTests.test_no_package�s0��
�
�
�{�
+��I�I�"�"�8�R�0�,�
+�
+��	�<�Ac�\�|jd|jjdd��y)Nzspam.eggs.baconrr�	spam.eggsrjrls r�test_in_packagez ResolveNameTests.test_in_package�s(�����*����/�/��+�F�	Hrc�\�|jd|jjdd��y)Nz
spam.bacon�..baconrxrjrls r�test_other_packagez#ResolveNameTests.test_other_package�s'���������/�/�	�;�G�	Irc��|jt�5|jjdd�ddd�y#1swYyxYw)Nr{rortrls r�test_escapezResolveNameTests.test_escape�s0��
�
�
�{�
+��I�I�"�"�9�f�5�,�
+�
+�rvN)	rrrrmrpruryr|r~rrrrgrg�s'��.�I�K�1�
H�
I�
6rrgc�h�eZdZGd�d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zy)�
FindSpecTestsc��eZdZedd��Zy)�FindSpecTests.FakeMetaFinderNc��|||fSr%r)r<�path�targets   r�	find_specz&FindSpecTests.FakeMetaFinder.find_spec�s��<@�$��<N�5Nr)NN)rrr�staticmethodr�rrr�FakeMetaFinderr��s��	�N�
�Nrr�c�^�d}tj|�5tj|�}d}|jj||�}||_||_|tj|<|jj|�}|j||�ddd�y#1swYyxYw�N�some_modz	a loader!)r�uncacher:r;r*r+rPrL�sys�modulesr�r
�rr<r&rQr0�founds      r�test_sys_moduleszFindSpecTests.test_sys_modules�s�����
�\�\�$�
��%�%�d�+�F� �F��>�>�,�,�T�6�:�D� &�F��"�F�O� &�C�K�K����I�I�'�'��-�E����U�D�)� �
�
�s�BB#�#B,c�T�d}tj|�5tj|�}|`d}|j
j
||�}||_|tj|<|jj|�}|j||�ddd�y#1swYyxYwr�)rr�r:r;rPr*r+rLr�r�r�r
r�s      r�#test_sys_modules_without___loader__z1FindSpecTests.test_sys_modules_without___loader__�s�����
�\�\�$�
��%�%�d�+�F��!� �F��>�>�,�,�T�6�:�D�"�F�O� &�C�K�K����I�I�'�'��-�E����U�D�)� �
�
�s�A=B�B'c�D�d}tj|�5tj|�}d|_|t
j|<|jt�5|jj|�ddd�ddd�y#1swY�xYw#1swYyxYw�Nr�)
rr�r:r;rLr�r�r,�
ValueErrorr��rr<r&s   r�test_sys_modules_spec_is_Nonez+FindSpecTests.test_sys_modules_spec_is_None�sw����
�\�\�$�
��%�%�d�+�F�"�F�O� &�C�K�K����"�"�:�.��	�	�#�#�D�)�/�	 �
�/�.��	 �
�s$�AB�B
�9B�
B	�B�Bc�L�d}tj|�5tj|�}|jj|d�}||_|tj|<|jj|�}|j||�ddd�y#1swYyxYwr�)rr�r:r;r*r+rLr�r�r�r
)rr<r&r0r�s     r�test_sys_modules_loader_is_Nonez-FindSpecTests.test_sys_modules_loader_is_None�s~����
�\�\�$�
��%�%�d�+�F��>�>�,�,�T�4�8�D�"�F�O� &�C�K�K����I�I�'�'��-�E����U�D�)�
 �
�
�s�A9B�B#c�Z�d}tj|�5tj|�}	|`|tj|<|jt�5|jj|�ddd�ddd�y#t
$rY�`wxYw#1swY�!xYw#1swYyxYwr�)rr�r:r;rL�AttributeErrorr�r�r,r�r�r�s   r� test_sys_modules_spec_is_not_setz.FindSpecTests.test_sys_modules_spec_is_not_set�s�����
�\�\�$�
��%�%�d�+�F�
��O�!'�C�K�K����"�"�:�.��	�	�#�#�D�)�/� �
��"�
��
��/�.�� �
�sE�B!�B�(B!�B�5B!�	B�B!�B�B!�B	�B!�!B*c�$�d}tj|�5tj|jg��5|j	|ddf|jj|��ddd�ddd�y#1swY�xYw#1swYyxYw)Nr�)�	meta_path)rr��import_stater�r
r�)rr<s  r�test_successzFindSpecTests.test_success�sq����
�\�\�$�
��"�"�d�.A�.A�-B�C�� � �$��d�!3�!%���!4�!4�T�!:�<�D� �
�C�C�� �
�s"�"B�/A:�)B�:B	�?B�Bc�X�|j|jjd��y)N�nevergoingtofindthismodule)�assertIsNonerr�rls r�test_nothingzFindSpecTests.test_nothing�s �����$�)�)�-�-�.J�K�Lrc���d}d}tj|d��5}tj|||�\}}|jj|�}|j	|d�|j|t
tj��|j|t
tj��|jj|�}|j||�ddd�y#1swYyxYw�Nro�hamT��pkg�r�temp_module�	submoduler��assertIsNot�assertIn�sortedr�r��assertNotInr
�rr<�subname�pkg_dir�fullname�_r0�
spec_agains        r�test_find_submodulez!FindSpecTests.test_find_submodule�s�������
�
�
�d��
-���.�.��w��@�K�H�a��9�9�&�&�x�0�D����T�4�(��M�M�$��s�{�{� 3�4����X�v�c�k�k�':�;����,�,�X�6�J����Z��.�.�
-�
-�s�CC,�,C5c�&�d}d}tj|d��5}|jj|�tj|||�\}}|jj|�}|j
|d�|j|ttj��|j|ttj��|jj|�}|j||�ddd�y#1swYyxYwr�)
rr��init�
import_moduler�r�r�r�r�r�r�r�r
r�s        r�+test_find_submodule_parent_already_importedz9FindSpecTests.test_find_submodule_parent_already_importeds�������
�
�
�d��
-���I�I�#�#�D�)��.�.��w��@�K�H�a��9�9�&�&�x�0�D����T�4�(��M�M�$��s�{�{� 3�4����X�v�c�k�k�':�;����,�,�X�6�J����Z��.�.�
-�
-�s�C"D�Dc��d}d}tj|d��5}tj|||�\}}d|z}|jj||�}|j	|d�|j|t
tj��|j|t
tj��|jj|�}|j||�ddd�y#1swYyxYw�Nror�Tr��.r�)	rr<r�r�r�r��relnamer0r�s	         r�test_find_relative_modulez'FindSpecTests.test_find_relative_modules�������
�
�
�d��
-���.�.��w��@�K�H�a��G�m�G��9�9�&�&�w��5�D����T�4�(��M�M�$��s�{�{� 3�4����X�v�c�k�k�':�;����,�,�X�6�J����Z��.�.�
-�
-�s�C
C2�2C;c���d}d}tj|d��5}tj|||�\}}d|z}|jt�5|jj|�ddd�|j
|ttj��|j
|ttj��ddd�y#1swY�dxYw#1swYyxYwr�)
rr�r�r,r-r�r�r�r�r�)rr<r�r�r�r�r�s       r�)test_find_relative_module_missing_packagez7FindSpecTests.test_find_relative_module_missing_package"s�������
�
�
�d��
-���.�.��w��@�K�H�a��G�m�G��"�"�;�/��	�	�#�#�G�,�0����T�6�#�+�+�#6�7����X�v�c�k�k�':�;�
.�
-�0�/��.�
-�s$�5C�C�-AC�C	�C�C%c��|jt�5|jjd�ddd�y#1swYyxYw)Nzmodule.name)r,�ModuleNotFoundErrorrr�rls r�test_find_submodule_in_modulez+FindSpecTests.test_find_submodule_in_module-s1���
�
�2�
3��I�I���
�.�4�
3�
3��	�;�AN)rrrr�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�r��sK��O�O�
*�
*�*�*�
*�<�M�/�/�/�	<�/rr�)r�rr*c��eZdZd�Zd�Zy)�MagicNumberTestsc�b�|jt|jj�d�y)N�)r
�lenr�MAGIC_NUMBERrls r�test_lengthzMagicNumberTests.test_length<s!������T�Y�Y�3�3�4�a�8rc�l�|j|jjjd��y)Ns
)�
assertTruerr��endswithrls r�test_incorporates_rnz%MagicNumberTests.test_incorporates_rn@s#������	�	�.�.�7�7��@�ArN)rrrr�r�rrrr�r�:s
��9�Brr�c��eZdZ	ejj
Zejejj
dud�d��Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zej&ej*d
k(xrej,dk(d�d��Zejejj
dud�d��Zejejj
dud�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"ejejj
dud�d��Z#ejejj
dud�d��Z$ejejj
dud�d��Z%ejejj
dud�d ��Z&ejejj
dud�d!��Z'y)"�PEP3147TestsNz1requires sys.implementation.cache_tag not be Nonec	��tjjdddd�}tjjdddddj|j��}|j|jj|d��|�y�	N�foo�bar�baz�qux.py�__pycache__�
qux.{}.pycrs��optimization��osr�r�format�tagr
r�cache_from_source�rr��expects   r�test_cache_from_sourcez#PEP3147Tests.test_cache_from_sourcePso��
�w�w�|�|�E�5�%��:�������e�U�E�=�*�1�1�$�(�(�;�=��������4�4�T��4�K��	!rc��tjtjdd�5|j	t
�5|jjd�ddd�ddd�y#1swY�xYw#1swYyxYw)N�	cache_tagzwhatever.py)r�	swap_attrr��implementationr,�NotImplementedErrorrr�rls r�#test_cache_from_source_no_cache_tagz0PEP3147Tests.test_cache_from_source_no_cache_tag[sZ��
�
�
�s�1�1�;��
E��"�"�#6�7��	�	�+�+�M�:�8�F�
E�7�7��F�
E�s"�A5�A)�A5�)A2	�.A5�5A>c��tjjdd�}tjjdddj|j��}|j|jj|d��|�y)Nzfoo.bar�filer�z
file{}.pycrsr�r�r�s   r�test_cache_from_source_no_dotz*PEP3147Tests.test_cache_from_source_no_dotase���w�w�|�|�I�v�.�������i��*�1�1�$�(�(�;�=��������4�4�T��4�K��	!rc�t�tjjdddd�}tj�5tj
d�|j
|jj|d�|jj|d���|j
|jj|d	�|jj|d
���ddd�tj�5tj
d�|jt�5|jj|d�ddd�|jt�5|jj|d	�ddd�ddd�y#1swY��xYw#1swY�XxYw#1swY�*xYw#1swYyxYw)Nr�r�r�r��ignoreF�r�Trs�error)r�r�r�warnings�catch_warnings�simplefilterr
rr�r,�DeprecationWarning�rr�s  r�%test_cache_from_source_debug_overridez2PEP3147Tests.test_cache_from_source_debug_overrideisC���w�w�|�|�E�5�%��:��
�
$�
$�
&��!�!�(�+����T�Y�Y�8�8��u�E�!�Y�Y�8�8��A�8�N�
P����T�Y�Y�8�8��t�D�!�Y�Y�8�8��B�8�O�
Q�	'��
$�
$�
&��!�!�'�*��"�"�#5�6��	�	�+�+�D�%�8�7��"�"�#5�6��	�	�+�+�D�$�7�7�	'�
&�
'�
&��7�6��6�6��	'�
&�sH�B$F
�7+F.�"F�?F.�F"�9F.�
F�F	�F.�"F+	�'F.�.F7c���d}tjjddj|j��}|j|jj|d��|�y�N�foo.pyr�z
foo.{}.pycrsr�r�r�s   r�test_cache_from_source_cwdz'PEP3147Tests.test_cache_from_source_cwdzsQ���������m�\�-@�-@����-J�K��������4�4�T��4�K��	!rc��tjjddd�}Gd�d�}tj�5tj
d�|j
|jj|g�|jj|d���|j
|jj|d	g�|jj|d
���|jt�5|jjd|��ddd�ddd�y#1swY�xYw#1swYyxYw)Nr�r�zbaz.pyc��eZdZd�Zy)�=PEP3147Tests.test_cache_from_source_override.<locals>.Bearishc��t�r%)�RuntimeErrorrls r�__bool__zFPEP3147Tests.test_cache_from_source_override.<locals>.Bearish.__bool__�s��l� 2rN)rrrrrrr�Bearishr�s��2rrr�r�r��rsz/foo/bar/baz.py)r�r�rr�r�r�r
rr�r,r)rr�rs   r�test_cache_from_source_overridez,PEP3147Tests.test_cache_from_source_override�s����w�w�|�|�E�5�(�3��	3�	3�
�
$�
$�
&��!�!�(�+����T�Y�Y�8�8��r�B�!�Y�Y�8�8��A�8�N�
P����T�Y�Y�8�8���t�D�!�Y�Y�8�8��B�8�O�
Q��"�"�<�0��	�	�+�+�,=�w�y�I�1�
'�
&�1�0��
'�
&�s%�B:D9�:"D-�D9�-D6	�2D9�9Ec���d}tjjddj|j��}|j|jj|d��|�yr�r�r�s   r�0test_cache_from_source_optimization_empty_stringz=PEP3147Tests.test_cache_from_source_optimization_empty_string�sQ���������m�\�-@�-@����-J�K��������4�4�T��4�K��	!rc��d}tjj}tjjddj
|j��}|dk(r|dz}n<|dkr|dj
|�z}n"dj
|�}|j|�|j|jj|d�	��y)
Nr�r��foo.{}r�.pyc��.opt-{}.pycz){!r} is a non-standard optimization levelr�)r��flags�optimizer�r�rr�r��skipTestr
rr�)rr��optimization_level�
almost_expectr��msgs      r�(test_cache_from_source_optimization_Nonez5PEP3147Tests.test_cache_from_source_optimization_None�s����� �Y�Y�/�/�������]�H�O�O�D�H�H�4M�N�
���"�"�V�+�F�
�1�
$�"�]�%9�%9�:L�%M�M�F�=�D�D�EW�X�C��M�M�#��������4�4�T��4�M��	!rc�,�d}tjtjz}tjjddj
|j��}|jj||��}|j||dj
|�z�|j|jj|d��|dz�|jt�5|jj|d��ddd�y#1swYyxYw)	Nr�r�r
r�r
�*z.opt-42.pyczpath/is/bad)
�string�
ascii_letters�digitsr�r�rr�r�rr�r
r,r�)rr��valid_charactersr�gots     r�'test_cache_from_source_optimization_setz4PEP3147Tests.test_cache_from_source_optimization_set�s�����!�/�/�&�-�-�?�������]�H�O�O�D�H�H�4M�N�
��i�i�)�)�$�=M�)�N������&��)=�)=�>N�)O�O�	Q�	
������4�4�T��4�K�&��6�	8��
�
�z�
*��I�I�'�'��=�'�I�+�
*�
*�s�#D
�
Dc��tj�5tjd�|jt�5|j
j
ddd��ddd�ddd�y#1swY�xYw#1swYyxYw)Nr�r�Frsr�)r�r�r�r,�	TypeErrorrr�rls r�;test_cache_from_source_debug_override_optimization_both_setzHPEP3147Tests.test_cache_from_source_debug_override_optimization_both_set�s`��
�
$�
$�
&��!�!�(�+��"�"�9�-��	�	�+�+�H�e�"�+�M�.�'�
&�-�-��'�
&�s#�+A<�A0�A<�0A9	�5A<�<B�\�/z/test meaningful only where os.altsep is definedc��|j|jjdd��dj|j��y)Nz\foo\bar\baz/qux.pyrsr�z#\foo\bar\baz\__pycache__\qux.{}.pyc)r
rr�r�r�rls r�)test_sep_altsep_and_sep_cache_from_sourcez6PEP3147Tests.test_sep_altsep_and_sep_cache_from_source�s=��	
����I�I�'�'�(@�r�'�R�6�=�=�d�h�h�G�	Irc	��tjdddd�}tjj	dddddj|j��}|j|jj|d��|�yr�)
�pathlib�PurePathr�r�rr�r�r
rr�r�s   r�$test_cache_from_source_path_like_argz1PEP3147Tests.test_cache_from_source_path_like_arg�sm������u�e�X�>�������e�U�E�=�*�1�1�$�(�(�;�=��������4�4�T��4�K��	!rz4requires sys.implementation.cache_tag to not be Nonec	��tjjdddddj|j��}tjjdddd�}|j|jj|�|�y�Nr�r�r�r�r�r��r�r�rr�r�r
r�source_from_cacher�s   r�test_source_from_cachez#PEP3147Tests.test_source_from_cache�sg��
�w�w�|�|�E�5�%��(�/�/����9�;�������e�U�E�8�<��������4�4�T�:�F�Crc�D�tjjddd�}tjt
jdd�5|jt�5|jj|�ddd�ddd�y#1swY�xYw#1swYyxYw)N�blahr�zwhatever.pycr�)r�r�rrr�r�r�r,r�rr+r�s  r�#test_source_from_cache_no_cache_tagz0PEP3147Tests.test_source_from_cache_no_cache_tag�sp���w�w�|�|�F�M�>�B��
�
�
�s�1�1�;��
E��"�"�#6�7��	�	�+�+�D�1�8�F�
E�7�7��F�
E�s$�B�B
�9B�
B	�B�Bc�Z�|jt|jjd�y)Nz/foo/bar/bazqux.pyc�r,r�rr+rls r�test_source_from_cache_bad_pathz,PEP3147Tests.test_source_from_cache_bad_path�s%��	
�����	�	�3�3�5J�	Lrc�Z�|jt|jjd�y)Nzfoo.cpython-32.pycr1rls r�test_source_from_cache_no_slashz,PEP3147Tests.test_source_from_cache_no_slash�s#�������	�	�3�3�5I�	Krc�Z�|jt|jjd�y)Nz__pycache__/foo.pycr1rls r�#test_source_from_cache_too_few_dotsz0PEP3147Tests.test_source_from_cache_too_few_dots�s#�������	�	�3�3�5J�	Lrc��|jt�5|jjd�ddd�y#1swYyxYw)Nz(__pycache__/foo.cpython-32.opt-1.foo.pycr1rls r�$test_source_from_cache_too_many_dotsz1PEP3147Tests.test_source_from_cache_too_many_dots�s2��
�
�
�z�
*��I�I�'�'�>�
@�+�
*�
*�r�c�Z�|jt|jjd�y)Nz"__pycache__/foo.cpython-32.foo.pycr1rls r�test_source_from_cache_not_optz+PEP3147Tests.test_source_from_cache_not_opt�s"�������	�	�3�3�0�	2rc�Z�|jt|jjd�y)Nz/foo/bar/foo.cpython-32.foo.pycr1rls r�$test_source_from_cache_no__pycache__z1PEP3147Tests.test_source_from_cache_no__pycache__�s"�������	�	�3�3�-�	/rc���tjjddj|j��}|j|jj|�d�y)Nr�zfoo.{}.opt-1.pycr�r*r�s  r�)test_source_from_cache_optimized_bytecodez6PEP3147Tests.test_source_from_cache_optimized_bytecodesE���w�w�|�|�M�+=�+D�+D�T�X�X�+N�O��������4�4�T�:�H�Erc��tjjddj|j��}|jt�5|jj|�ddd�y#1swYyxYw)Nr�zfoo.{}.opt-.pyc)	r�r�rr�r�r,r�rr+r�s  r�+test_source_from_cache_missing_optimizationz8PEP3147Tests.test_source_from_cache_missing_optimization	sR���w�w�|�|�M�+<�+C�+C�D�H�H�+M�N��
�
�
�z�
*��I�I�'�'��-�+�
*�
*�s�A4�4A=c	��tjdddddj|j��}tj
j
dddd�}|j|jj|�|�yr))
r%r&r�r�r�r�rr
rr+r�s   r�$test_source_from_cache_path_like_argz1PEP3147Tests.test_source_from_cache_path_like_argse������u�e�]� ,� 3� 3�D�H�H� =�?�������e�U�E�8�<��������4�4�T�:�F�Crc��tjjtjjdd�tjjtjjdd�tjjtjjdd�tjjzg}d}tjdk(rd}|D�cgc]}|�|����
}}|dd	gz
}|D]�}|j|�
�5|tjjtjjddd
d�z}tjj|ddd
dj
|j��}tj|�5|j|jj|d��|�ddd�ddd���ycc}w#1swY�xYw#1swY��xYw)N�tmp�bytecodeu☃ztrailing-slashrs�ntzC:z
\\?\C:\fooz\\localhost\c$\bar)r�r�r�r�r�r�r�)r�r�r�sepr<�subTestr�r�r�temporary_pycache_prefixr
r�)r�pycache_prefixes�drive�prefix�pycache_prefixr�r�s       r�.test_cache_from_source_respects_pycache_prefixz;PEP3147Tests.test_cache_from_source_respects_pycache_prefixs���
�G�G�L�L������e�Z�8��G�G�L�L������e�X�6��G�G�L�L������e�-=�>������L�
��
��
�7�7�d�?��E�1A� C�1A�v�5�'�&��"�1A�
� C���0E� F�F��.�N����>��2��r�w�w�|�|��G�G�K�K���u�h� @�@�������"�E�5�%� �'�'����1�3���2�2�>�B��$�$��	�	�3�3�D�r�3�J�� �C�
3�2�/�� C�C�B��
3�2�s+�!
G�BG0�.G$�G0�$G-�)G0�0G:	c
��tjjtjjdd�}tjjdddd�}tjj	tj
��dtjjz}tjj|tjj
tj
�|�dddd|j�d	��}tj|�5|j|jj|d
��tjj|��ddd�y#1swYyxYw)NrDrEr�r�r�r�r�qux.rrsr�)
r�r�rrG�
splitdrive�getcwd�relpathr�rrIr
r��normpath)rrMr��rootr�s     r�7test_cache_from_source_respects_pycache_prefix_relativezDPEP3147Tests.test_cache_from_source_respects_pycache_prefix_relative4s��������b�g�g�k�k�5�*�E���w�w�|�|�E�5�%��:���w�w�!�!�"�)�)�+�.�q�1�B�G�G�K�K�?���������G�G�O�O�B�I�I�K��.��5�%�4����z��!6�8���
*�
*�>�
:�����	�	�+�+�D�r�+�B���� � ��(�
*�;�
:�
:�s
�"AE6�6E?c	��tjjtjjdd�}tjj|dddd|j�d��}tjjtjjdddd�}tj|�5|j|j
j|�|�ddd�y#1swYyxYw)	NrDrEr�r�r�rPrr��	r�r�rrGr�rrIr
r+�rrMr�r�s    r�,test_source_from_cache_inside_pycache_prefixz9PEP3147Tests.test_source_from_cache_inside_pycache_prefixFs��������b�g�g�k�k�5�*�E���w�w�|�|�N�E�5�%�"�4�8�8�*�D�1�3�������b�g�g�k�k�5�%���I��
�
*�
*�>�
:����T�Y�Y�8�8��>��G�;�
:�
:�s�;,C0�0C9c	���tjjtjjdd�}tjjddddd|j�d��}tjjdddd	�}tj|�5|j|j
j|�|�ddd�y#1swYyxYw)
NrDrEr�r�r�r�rPrr�rXrYs    r�-test_source_from_cache_outside_pycache_prefixz:PEP3147Tests.test_source_from_cache_outside_pycache_prefixSs��������b�g�g�k�k�5�*�E���w�w�|�|�E�5�%��"�4�8�8�*�D�1�3�������e�U�E�8�<��
�
*�
*�>�
:����T�Y�Y�8�8��>��G�;�
:�
:�s�",C�C )(rrrr�r�r�r��unittest�skipIfr�r�r�r�r�rrrrr�
skipUnlessr�rG�altsepr#r'r,r/r2r4r6r8r:r<r>r@rBrNrVrZr\rrrr�r�Jsv��W�

�
�
�
&�
&�C��X�_�_�S�'�'�1�1�T�9�H�J�!�J�!�;�!�8�"!�J�$!�!� J�"N��X������4��<�B�I�I��,<�F�H�I�H�I��X�_�_�S�'�'�1�1�T�9�H�J�!�J�!��X�_�_�S�'�'�1�1�T�9�K�M�D�M�D�2�L�K�
L�
@�
2�/�F�
.��X�_�_�S�'�'�1�1�T�9�K�M�D�M�D��X�_�_�S�'�'�1�1�T�9�K�M� �M� �6�X�_�_�S�'�'�1�1�T�9�K�M�*�M�*� �X�_�_�S�'�'�1�1�T�9�K�M�	H�M�	H��X�_�_�S�'�'�1�1�T�9�K�M�	H�M�	Hrr�c�l�eZdZ	ejejjdvd�d��Zy)r�)�	candidate�finalz8only applies to candidate or final python release levelsc��d}tjtjjddd�}d}|j|||�y)Ni�
r�littlea�To avoid breaking backwards compatibility with cached bytecode files that can't be automatically regenerated by the current user, candidate and final releases require the current  importlib.util.MAGIC_NUMBER to match the expected magic number in this test. Set the expected magic number in this test to the current MAGIC_NUMBER to continue with the release.

Changing the MAGIC_NUMBER for a maintenance release requires discussion in python-dev and notification of community stakeholders.)�int�
from_bytesrrr�r
)r�EXPECTED_MAGIC_NUMBER�actualrs    r�test_magic_numberz"MagicNumberTests.test_magic_numberjsJ��&!%�����	��� ;� ;�B�Q� ?��J��	
&�	�	
���.���<rN)	rrrr]r_r��version_info�releaselevelrjrrrr�r�fs@����X������%�%�)?�?�B��=�	�=rzsubinterpreters requiredc���eZdZejd�Zd�Zd�Zeje
dud�d��Zejedud�d��Z
ejedud�d	��Zy)
�,IncompatibleExtensionModuleRestrictionsTestszO^<class 'ImportError'>: module (.*) does not support loading in subinterpretersc�$�tjd��}	tj||�y#tj$rM}|jjt
|��x}r|j�\}t|��Yd}~yd}~wwxYw)NT��isolated�	�
_interpreters�create�
run_string�RunFailedError�ERROR�match�str�groupsr-�r�script�interpid�exc�m�modnames      r�run_with_own_gilz=IncompatibleExtensionModuleRestrictionsTests.run_with_own_gil�sx�� �'�'��6��	+��$�$�X�v�6���+�+�	+��J�J�$�$�S��X�.�.�q�.��8�8�:���!�'�*�*�/��	+���/�B�AB
�
Bc�$�tjd��}	tj||�y#tj$rM}|jjt
|��x}r|j�\}t|��Yd}~yd}~wwxYw)NFrprrr{s      r�run_with_shared_gilz@IncompatibleExtensionModuleRestrictionsTests.run_with_shared_gil�sx�� �'�'��7��	+��$�$�X�v�6���+�+�	+��J�J�$�$�S��X�.�.�q�.��8�8�:���!�'�*�*�/��	+�r�Nz%test requires _testsinglephase modulec��tjd�}|jd�5|j|�ddd�|jd�5|j	|�ddd�tjd�}|jd�5|jt�5|j|�ddd�ddd�|jd�5|jt�5|j	|�ddd�ddd�y#1swY��xYw#1swY��xYw#1swY�sxYw#1swY�wxYw#1swY�BxYw#1swYyxYw)Nz�
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                import _testsinglephase
            �check disabled, shared GIL�#check disabled, per-interpreter GILz�
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                import _testsinglephase
            �check enabled, shared GIL�"check enabled, per-interpreter GIL)�textwrap�dedentrHr�r�r,r-�rr|s  r�test_single_phase_init_modulezJIncompatibleExtensionModuleRestrictionsTests.test_single_phase_init_module�s�����"���
�\�\�6�
7��$�$�V�,�8�
�\�\�?�
@��!�!�&�)�A����&
���
�\�\�5�
6��"�"�;�/��(�(��0�0�7��\�\�>�
?��"�"�;�/��%�%�f�-�0�@�
?�8�
7��
@�
@��0�/��7�
6��0�/��@�
?�s_�D�D �D8�(D,�:D8�E�1E�E�D� D)�,D5	�1D8�8E�E
	�	E�Ez$test requires _testmultiphase modulec��tjdtj�d��}|tjd�z}|j	d�5|j|�ddd�|j	d�5|j
|�ddd�|tjd�z}|j	d�5|j|�ddd�|j	d�5|jt�5|j
|�ddd�ddd�y#1swY��xYw#1swY��xYw#1swY�kxYw#1swY�6xYw#1swYyxYw)	Nz�
            from importlib.util import spec_from_loader, module_from_spec
            from importlib.machinery import ExtensionFileLoader

            name = '_test_shared_gil_only'
            filename = zy
            loader = ExtensionFileLoader(name, filename)
            spec = spec_from_loader(name, loader)

            a

            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                module = module_from_spec(spec)
                loader.exec_module(module)
            r�r�a
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                module = module_from_spec(spec)
                loader.exec_module(module)
            r�r�)	r�r��_testmultiphaser`rHr�r�r,r-)r�	prescriptr|s   r�'test_incomplete_multi_phase_init_modulezTIncompatibleExtensionModuleRestrictionsTests.test_incomplete_multi_phase_init_module�s-���O�O�)�
(�0�0�3�4
�	%�	�	��X�_�_�.�����\�\�6�
7��$�$�V�,�8�
�\�\�?�
@��!�!�&�)�A��X�_�_�.�����\�\�5�
6��$�$�V�,�7�
�\�\�>�
?��"�"�;�/��%�%�f�-�0�@�
?�8�
7��
@�
@��7�
6��0�/��@�
?�sH�D#�<D/�?D;�*E�E�E�#D,�/D8�;E�E	�E�Ec��tjd�}|jd�5|j|�ddd�|jd�5|j	|�ddd�tjd�}|jd�5|j|�ddd�|jd�5|j	|�ddd�y#1swY��xYw#1swY��xYw#1swY�MxYw#1swYyxYw)Nz�
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                import _testmultiphase
            r�r�z�
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                import _testmultiphase
            r�r�)r�r�rHr�r�r�s  r�%test_complete_multi_phase_init_modulezRIncompatibleExtensionModuleRestrictionsTests.test_complete_multi_phase_init_module�s������"���
�\�\�6�
7��$�$�V�,�8�
�\�\�?�
@��!�!�&�)�A����&
���
�\�\�5�
6��$�$�V�,�7�
�\�\�>�
?��!�!�&�)�@�
?�8�
7��
@�
@��7�
6��
?�
?�s/�C�C$�C0�=C<�C!�$C-�0C9�<D)rrr�re�compilerwr�r�r]r^�_testsinglephaser�r�r�r�rrrrnrn�s���
�B�J�J�h�i�E�+�+��X�_�_�%��-�/V�W�.�X�.�.�X�_�_�_��,�.T�U�!.�V�!.�F�X�_�_�_��,�.T�U�*�V�*rrn�__main__)3�test.test_importlibr�import_importlibr8r�r*�importlib_util�importlib.utilrr�r%r�rr�r)rr�r:r]�
unittest.mockr�r�r-r��_xxsubinterpretersrsr�r�	test_both�Frozen_DecodeSourceBytesTests�Source_DecodeSourceBytesTestsr �Frozen_ModuleFromSpecTests�Source_ModuleFromSpecTestsrg�Frozen_ResolveNameTests�Source_ResolveNameTestsr��Frozen_FindSpecTests�Source_FindSpecTestsr��Frozen_MagicNumberTests�Source_MagicNumberTestsr��Frozen_PEP3147Tests�Source_PEP3147Tests�TestCaser^rnr�mainrrr�<module>r�sB��$��d���O�,���t���[�)��!�D�!�!�"7�8�	�&��&�&�'7�8���	��	�
�
������������.�
@�@�.�T�^�^�*��@����F9�F9�T�D�N�N�&�C�9�&�(����
6�6�F�T�^�^�$�>�:����@/�@/�J�T�^�^�M��>�#,�.����
B�B��T�^�^�$�>�:����TH�TH�r�T�^�^�L�~�6����&=�x�(�(�&=�R�����$�&�(B�C�f*�8�3D�3D�f*�D�f*�R�z���H�M�M�O���E���������O������M��s6�F4�G�G�4F?�>F?�G
�G
�G�G

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists