HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/test_importlib/__pycache__/util.cpython-312.opt-2.pyc
�

h�e�0���ddlZddlZddlZddlZddlmZmZmZddlZddl	Z	ddl
Z	ddlmZddlm
Z
ddlZddlZddlZddlZej$�Zde_de_dej,vrde_dej,vrde_ej$�adt._dt._dt._dt._dt._d�Ze�d	�Zd$d
�Zd$d�Z d$d�Z!d
Z"ejFdvrBe$jK�Z&e&e$k(re$jO�Z&e	j0jQe&�sdZ"ed�dZ)e*ejV�e*e)jV�d�Z+d�Z,d%d�Z-d�Z.ej^d��Z0ej^d%dd�d��Z1ej^d��Z2Gd�d�Z3Gd�de3�Z4d�Z5d�Z6ej^d��Z7ej^d ��Z8d!�Z9Gd"�d#�Z:y)&�N)�	machinery�util�invalidate_caches)�
import_helper)�	os_helper�errno�	importlib�_testsinglephasec�Z�tjD]�}tjD]�}tj
|z}tjj||�}tjj|�s�V|t_|t_	|t_
|t_y��y�N)�sys�pathr�EXTENSION_SUFFIXES�
EXTENSIONS�name�os�join�exists�ext�filename�	file_path)rrrrs    �?/opt/alt/python312/lib64/python3.12/test/test_importlib/util.py�_extension_detailsr s}�����	���/�/�	�C�!����,�H������T�8�4�I��w�w�~�~�i�(�"&�
��!$�
��&.�
�#�'0�
�$��	�	�c�x�	d|vrdnd}tj|�}tj||d��}||d�S)N�.)r	�)�_frozen_importlib�_frozen_importlib_external)�fresh�blocked��Frozen�Source)r�import_fresh_module)�module_namer �frozen�sources    r�import_importlibr)0sF��K�!�[�0�N�b�E�
�
.�
.�{�
;�F�
�
.�
.�{�%�1d�f�F���/�/rc�h�|�tj}nt|t�s||}dj	||j
�}||f}t
j||�}|j|_|j
|_	||_
|j�D]\}}||}	t|||	��|S)Nz{}_{})
�unittest�TestCase�
isinstance�type�format�__name__�types�	new_class�
__module__�_NAME�_KIND�items�setattr)
�cls�kind�base�kwargsr�bases�specialized�attr�values�values
          r�specialize_classrA9s����|�� � ��
��d�
#��D�z���>�>�$����-�D�
�$�K�E��/�/�$��.�K� �^�^�K�����K���K������*���f��t�����T�5�)�*��rc�B�t|d|fi|��}t|d|fi|��}||fS)Nr#r$)rA)r8r:r;r'r(s     r�split_frozenrCLs2��
�c�8�T�
<�V�
<�F�
�c�8�T�
<�V�
<�F��6�>�rc��t||fi|��Sr)rC)�
test_classr:r;s   r�	test_bothrFRs���
�D�3�F�3�3rT)�win32�cygwinFr$r"c�F�	tjtd�|�S)Nz&requires a case-insensitive filesystem)r+�skipIf�CASE_INSENSITIVE_FS)�tests r�case_insensitive_testsrMes1���F�8�?�?�2�2�D�F�FJ�L�Lrc���tjj||dz�}t|dd��5}|j	|�ddd�dj||�|fS#1swY�xYw)N�.py�w�utf-8��encodingz{}.{})rrr�open�writer/)�parentr�pkg_dir�contentr�subfiles      r�	submodulerZls_��
�7�7�<�<�����.�D�	
�d�C�'�	*��g��
�
�g����>�>�&�$�'��-�-���s�A � A)c��	t|d�5}|jd�tj|�cddd�S#1swYyxYw)N�rb�)rT�seek�marshal�load)�pyc_path�pyc_fs  r�get_code_from_pycrcssA���
�h��	�#��
�
�
�2���|�|�E�"�#�#�#�s	�&>�Ac'�NK�	|D]2}|dvrtdj|���	tj|=�4	d��|D]}	tj|=�y#t$rY�_wxYw#t$rY�2wxYw#|D]#}	tj|=�#t$rY�!wxYwwxYw�w)N)r
r_zcannot uncache {})�
ValueErrorr/r
�modules�KeyError)�namesrs  r�uncacheri}s����������%�%��0�7�7��=�>�>�	����D�!�	��
��	�D�
��K�K��%�	���	��	���
��
���	�D�
��K�K��%���
��
��	�s��%B%�A�B%�A8�B%�A)�B%�	A&�#B%�%A&�&B%�)	A5�2B%�4A5�5B%�8B"�?B�B"�	B	�B"�B	�B"�"B%)�pkgc	#�K�tjD�cgc]}|jd�d|k(s�|��}}tjd�5}t|g|���5t
j|�5t�tjj||�}|r6tjj|d�}tj|�n	|dz}|�d}|�(t|dd��5}|j|�ddd�|��ddd�ddd�ddd�ycc}w#1swY�+xYw#1swY�+xYw#1swY�/xYw#1swYyxYw�w)	Nrrz__init__.pyrO�rPrQrR)r
rf�	partitionr�temp_cwdrir�
DirsOnSysPathrrrr�mkdirrTrU)	rrXrj�n�	conflicts�cwd�location�modpath�modfiles	         r�temp_modulerw�s0�����K�K�G�q�1�;�;�s�+;�A�+>�$�+F��G�I�G�	�	�	�D�	!��S�
�T�
&�I�
&�	��,�,�S�1�
�!�#��7�7�<�<��T�2��� �g�g�l�l�8�]�C�G��H�H�T�N�&��.�G���"$���&��g�s�W�=�/���
�
�g�.�/���!
�	����H�"/�/��
�
��	�	����su�E�D#�D#�E�

E�E�0A<D4�,D(	�>D4�
E�E�E�(D1
�-D4�4D=�9E�E		�E�E�Ec+�K�	i}	dgfdgfdgfdiffD]8\}}tt|�||<||vr	||}||=n|}tt||��:t|�rt	dj|���d��|j
�D]\}}tt||��y#|j
�D]\}}tt||��wxYw�w)N�	meta_pathr�
path_hooks�path_importer_cachezunrecognized arguments: {})�getattrr
r7�lenrer/r6)r;�	originalsr>�default�	new_valuer@s      r�import_stater��s�������I�&�*�B�/�&�"��+�R�0�4�b�9�;�		*�M�D�'�&�c�4�0�I�d�O��v�~�"�4�L�	��4�L�#�	��C��y�)�		*��v�;��9�@�@��H�I�I�
�$�?�?�,�	&�K�D�%��C��u�%�	&��9�?�?�,�	&�K�D�%��C��u�%�	&�s�C�A2B#�9*C�#+C�Cc�,�eZdZ	id�d�Zd�Zd�Zd�Zy)�
_ImporterMock)�module_codec��i|_i|_|D]�}|jd�s|}n|dtd�}d|vrd}n||k(r|j	dd�d}n|}tj|�}||_d|_||_	||_
||k7rdg|_||j|<||vs��|||j|<��y)N�	.__init__r�rz<mock __file__>z<mock __path__>)rfr��endswithr}�rsplitr1�
ModuleType�
__loader__�__file__�__package__r>�__path__)�selfr�rhr�import_name�package�modules       r�__init__z_ImporterMock.__init__�s����������	I�D��=�=��-�"��"�#5�S��%5�$5�6���$������$��+�+�c�1�-�a�0��%���%�%�k�2�F� $�F��/�F�O�!(�F���F�K��d�"�#4�"5���(.�D�L�L��%��k�)�0;�K�0H�� � ��-�)	Irc� �|j|Sr)rf)r�rs  r�__getitem__z_ImporterMock.__getitem__�s���|�|�D�!�!rc��t|jj��|_|jj	�|Sr)rirf�keys�_uncache�	__enter__)r�s rr�z_ImporterMock.__enter__�s0������!2�!2�!4�5��
��
�
���!��rc�>�|jjddd�yr)r��__exit__)r��exc_infos  rr�z_ImporterMock.__exit__�s���
�
���t�T�4�0rN)r0r3�__qualname__r�r�r�r�rrrr�r��s��:�+-�I�2"��
1rr�c�"�eZdZ	dd�Zd�Zd�Zy)�	mock_specNc
��	|j|}tj||j|t|dd���}|S#t$rYywxYw)Nr�)�loader�submodule_search_locations)rfrgr�spec_from_file_locationr�r|)r��fullnamerrVr��specs      r�	find_speczmock_spec.find_spec�sZ��	��\�\�(�+�F��+�+��&�/�/�$�+2�6�:�t�+L�N������	��	�s�A�	A
�A
c�p�|j|jvrt�|j|jSr)rrf�ImportError)r�r�s  r�
create_modulezmock_spec.create_modules+���9�9�D�L�L�(����|�|�D�I�I�&�&rc�t�	|j|jj�y#t$rYywxYwr)r��__spec__rrg)r�r�s  r�exec_modulezmock_spec.exec_modules6��	�2�D���V�_�_�1�1�2�4���	��	�s�(+�	7�7)NN)r0r3r�r�r�r�rrrr�r��s��+��'�
rr�c���	tjrtjd���St	j
���fd��}|S)Nzrelies on writing bytecodec���tj}dt_	�|i|��}|t_|S#|t_wxYw)NF)r
�dont_write_bytecode)�argsr;�original�	to_return�fxns    �r�wrapperz&writes_bytecode_files.<locals>.wrappersD����*�*��"'���	/��T�,�V�,�I�&.�C�#����'/�C�#�s	�3�
A)r
r�r+�skip�	functools�wraps)r�r�s` r�writes_bytecode_filesr�sJ���1�
���:�x�}�}�9�:�3�?�?��_�_�S������Nrc���		tjtjj|��y#t$r(}|j
t
jk7r�Yd}~yd}~wwxYwr)rrpr�dirname�OSErrorr�EEXIST)�
bytecode_path�errors  r�ensure_bytecode_pathr� sM����
���������/�0�����;�;�%�,�,�&��'���s�26�	A'�A"�"A'c#�K�	tj}|t_	d��|t_y#|t_wxYw�wr)r
�pycache_prefix)�prefix�_orig_prefixs  r�temporary_pycache_prefixr�,s4����0��%�%�L��C��*�
�)����\���s�A�0�A�
=�Ac'�K�	d}g}i}d}d}	tj�}||d<t�}|D�]P}|jd�s|}	n|dt	d�}	|j|	�|	tjvrtj|	=|jd�}
|}|
ddD]h}tjj||�}tjj|�r�Ctj|�|j|��jtjj||
ddz�}t|dd	�
�5}
|
j!|j#|��ddd�|j|�|||<��St%|�}|j'�t)|g��}|j'�|��|�|j+ddd�|�|j+ddd�t-j.|�y#1swY��xYw#|�|j+ddd�|�|j+ddd�t-j.�wxYw�w)Nzattr = {0!r}z.rootr�r�r���rOrPrQrR)r)�tempfile�mkdtemp�setr�r}�addr
rf�splitrrrrrp�appendrTrUr/rir�r�r�r�rmtree)rhr(�
created_paths�mapping�
state_manager�uncache_manager�temp_dir�import_namesrr��
name_partsr�	directory�files              r�create_modulesr�7s+����
��F��M��G��M��O�"#��#�#�%��#�����u���	&�D��=�=��,�"��"�#5�S��%5�$5�6�����[�)��c�k�k�)��K�K��,����C��J� �I�'���_�
4�	��G�G�L�L��I�>�	��w�w�~�~�i�0��H�H�Y�'�!�(�(��3�	
4�
�����Y�
�2���0F�G�I��i��w�7�
0�4��
�
�6�=�=��.�/�
0�� � ��+�%�G�D�M�'	&�("�<�0���!�!�#�$�8�*�5�
����!��
��$��"�"�4��t�4��&��$�$�T�4��6�����"�
0�
0���$��"�"�4��t�4��&��$�$�T�4��6�����"�s?�I�CH
�*AH
�!H�'AH
�AI�H
	�H
�
AI�Ic����	��fd�}|S)Nc���|�vrt��Sr)r�)�entry�entries�importers ��r�hookzmock_path_hook.<locals>.hookss���������rr)r�r�r�s`` r�mock_path_hookr�qs���&���Krc��eZdZd�Zy)�CASEOKTestBasec�\��d}t�fd�|D��|k7r�jd�yy)N)sPYTHONCASEOK�PYTHONCASEOKc3�v�K�|]0}|�jjjjv���2y�wr)r	�_bootstrap_external�_os�environ)�.0�xr�s  �r�	<genexpr>z4CASEOKTestBase.caseok_env_changed.<locals>.<genexpr>~s4�����,���D�N�N�6�6�:�:�B�B�B�,�s�69z/os.environ changes not reflected in _os.environ)�any�skipTest)r��should_exist�
possibilitiess`  r�caseok_env_changedz!CASEOKTestBase.caseok_env_changed|s7���7�
��,�*�,�,�/;�<��M�M�K�L�<rN)r0r3r�r�rrrr�r�zs��Mrr�r)rl);�builtins�
contextlibrr�r	rrrr_r�os.path�test.supportrrr+r
r�r1�SimpleNamespace�BUILTINS�	good_name�bad_name�builtin_module_namesrrrrrrrr)rArCrFrK�platformr��upper�changed_name�lowerr�source_importlib�staticmethod�
__import__rMrZrc�contextmanagerrirwr�r�r�r�r�r�r�r�r�rrr�<module>rs$������8�8��	��&�"��
���!�5� � �"��������
�c�&�&�&� �H���c�.�.�.�#�H��
"�U�
"�
"�
$�
��
���
���
���
��$�
�����0��&�4����<�<�*�*��>�>�#�L��x���~�~�'��
�7�7�>�>�,�'�#��#�K�0��:��$�X�%8�%8�9�$�%5�%@�%@�A�C�
�L�.�#�������0��������.���&��&�:&1�&1�R�
��4�"	����*��*����6#��6#�r�M�Mr