Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/importlib/__pycache__/util.cpython-311.opt-1.pyc

�

c��f�1��P�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZd
dlmZd
dlZd
dlZd
dlZd
dlZd
dlZd
dlZd�Zd�Zdd�Zdd�Zed���Zd�Zd�Zd�ZGd�dej��Z Gd�de��Z!dS)z-Utility code for constructing importers, etc.�)�Loader)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER)�_RAW_MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNc�6�tjt|��S)zBReturn the hash of *source_bytes* as used in hash-based pyc files.)�_imp�source_hashr	)�source_bytess �5/opt/alt/python311/lib64/python3.11/importlib/util.pyrrs����-�|�<�<�<�c���|�d��s|S|s tdt|���d����d}|D]}|dkrn|dz
}�t||d�||��S)z2Resolve a relative module name to an absolute one.�.zno package specified for z% (required for relative module names)rrN)�
startswith�ImportError�reprr)�name�package�level�	characters    r�resolve_namers����?�?�3���B���
�B��A�d�4�j�j�A�A�A�B�B�	B�
�E����	������E�
��
�����e�f�f��w��6�6�6rc�(�|tjvrt||��Stj|}|�dS	|j}|�"t	d�|�����|S#t$r$t	d�|����d�wxYw)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    Dotted names do not have their parent packages implicitly imported. You will
    most likely need to explicitly import all parent packages in the proper
    order for a submodule to get the correct spec.

    N�{}.__spec__ is None�{}.__spec__ is not set)�sys�modulesr�__spec__�
ValueError�format�AttributeError)r�path�module�specs    r�_find_spec_from_pathr,+s����3�;����$��%�%�%���T�"���>��4�	��?�D��|� �!6�!=�!=�d�!C�!C�D�D�D��K���	N�	N�	N��5�<�<�T�B�B�C�C��M�	N���s�A#�#.Bc�>�|�d��rt||��n|}|tjvrt|�d��d}|rEt|dg���}	|j}n,#t$r}td|�d|��|���|�d}~wwxYwd}t||��Stj|}|�dS	|j
}|�"td	�|�����|S#t$r$td
�|����d�wxYw)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    If the name is for submodule (contains a dot), the parent module is
    automatically imported.

    The name and package arguments work the same as importlib.import_module().
    In other words, relative module names (with leading dots) work.

    rr�__path__)�fromlistz __path__ attribute not found on z while trying to find )rNr!r")
rrr#r$�
rpartition�
__import__r.r(�ModuleNotFoundErrorrr%r&r')	rr�fullname�parent_name�parent�parent_path�er*r+s	         r�	find_specr8Js}��"/3�o�o�c�.B�.B�L�|�D�'�*�*�*��H��s�{�"�"��)�)�#�.�.�q�1���		���z�l�C�C�C�F�
P�$�o����!�
P�
P�
P�)�9�{�9�9�,4�9�9�?G�I�I�I�NO�P�����
P����
�K��(�K�0�0�0���X�&���>��4�	��?�D��|� �!6�!=�!=�d�!C�!C�D�D�D��K���	N�	N�	N��5�<�<�T�B�B�C�C��M�	N���s$�&A.�.
B�8B�B�C.�..Dc#�bK�|tjv}tj�|��}|s3tt��|��}d|_|tj|<	|V�n1#t
$r$|s	tj|=n#t$rYnwxYwYnwxYwd|_dS#d|_wxYw)NTF)r#r$�get�type�__initializing__�	Exception�KeyError)r�	is_reloadr*s   r�_module_to_loadr@ws��������#�I�
�[�_�_�T�
"�
"�F��#���c���4����#'���"���D��	(������������	�
��K��%�%���
�
�
���
������	����#(������%���'�'�'�'sN�&A+�*B%�+B�8
B�B�
B�B�B�B�B%�B�B%�%	B.c�F��tj����fd���}|S)zOSet __package__ on the returned module.

    This function is deprecated.

    c����tjdtd����|i|��}t|dd���A|j|_t
|d��s%|j�d��d|_|S)N�kThe import system now takes care of this automatically; this decorator is slated for removal in Python 3.12���
stacklevel�__package__r.rr)�warnings�warn�DeprecationWarning�getattr�__name__rG�hasattrr0)�args�kwargsr*�fxns   �r�set_package_wrapperz(set_package.<locals>.set_package_wrapper�s�����
�L�(�Q�	8�	8�	8�	8���d�%�f�%�%���6�=�$�/�/�7�!'��F���6�:�.�.�
K�%+�%7�%B�%B�3�%G�%G��%J��"��
r��	functools�wraps)rPrQs` r�set_packagerU�s;����_�S���	�	�	�	���	��rc�F��tj����fd���}|S)zNSet __loader__ on the returned module.

    This function is deprecated.

    c���tjdtd����|g|�Ri|��}t|dd���||_|S)NrCrDrE�
__loader__)rHrIrJrKrX)�selfrNrOr*rPs    �r�set_loader_wrapperz&set_loader.<locals>.set_loader_wrapper�sg����
�L�(�Q�	8�	8�	8�	8���T�+�D�+�+�+�F�+�+���6�<��.�.�6� $�F���
rrR)rPrZs` r�
set_loaderr[�s;����_�S�����������rc�~��tjdtd���tj����fd���}|S)a*Decorator to handle selecting the proper module for loaders.

    The decorated function is passed the module to use instead of the module
    name. The module passed in to the function is either from sys.modules if
    it already exists or is a new module. If the module is new, then __name__
    is set the first argument to the method, __loader__ is set to self, and
    __package__ is set accordingly (if self.is_package() is defined) will be set
    before it is passed to the decorated function (if self.is_package() does
    not work for the module it will be set post-load).

    If an exception is raised and the decorator created the module it is
    subsequently removed from sys.modules.

    The decorator assumes that the decorated function takes the module name as
    the second argument.

    rCrDrEc�.��t|��5}||_	|�|��}|r||_n8|�d��d|_n#t
tf$rYnwxYw�||g|�Ri|��cddd��S#1swxYwYdS)Nrr)r@rX�
is_packagerGr0rr()rYr3rNrOr*r^rPs      �r�module_for_loader_wrapperz4module_for_loader.<locals>.module_for_loader_wrapper�s
���
�X�
&�
&�	6�&� $�F��
E�!�_�_�X�6�6�
��E�)1�F�&�&�)1�)<�)<�S�)A�)A�!�)D�F�&�&��
 ��0�
�
�
���
�����3�t�V�5�d�5�5�5�f�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6�	6�	6s3�B
�A�+B
�A.�+B
�-A.�.B
�
B�B)rHrIrJrSrT)rPr_s` r�module_for_loaderr`�sa���$
�M�H�$��4�4�4�4��_�S���
6�
6�
6�
6���
6�%�$rc��eZdZdZd�Zd�ZdS)�_LazyModulezKA subclass of the module type which triggers loading upon attribute access.c�|�t�|d��}|j}|d5t�|d��tu�rH|dr't�||��cddd��Sd|d<t�|d��}|j}|d}|}i}|���D]@\}	}
|	|vr|
||	<�t
||	��t
||	��kr|
||	<�A|j�|��|tj
vrCt
|��t
tj
|��krtd|�d	����|�|��tj|_ddd��n#1swxYwYt!||��S)
z8Trigger the load of the module and return the attribute.r%�lock�	__class__�
is_loadingNT�__dict__zmodule object for z. substituted in sys.modules during a lazy load)�object�__getattribute__�loader_staterbr�items�id�loader�exec_moduler#r$r&�update�types�
ModuleTypererK)rY�attrr%rjrg�
original_name�
attrs_then�	attrs_now�
attrs_updated�key�values           rriz_LazyModule.__getattribute__�s*���*�*�4��<�<���,��
�&�
!�+	2�+	2��&�&�t�[�9�9�[�H�H�
 ��-�?�!�2�2�4��>�>�+	2�+	2�+	2�+	2�+	2�+	2�+	2�+	2�.2��\�*�!�2�2�4��D�D��!)�
�
�*�*�5�
�$�	� "�
�"+�/�/�"3�"3�3�3�J�C���*�,�,�-2�
�c�*�*��I�c�N�+�+�r�*�S�/�/B�/B�B�B�-2�
�c�*����+�+�D�1�1�1�!�C�K�/�/��$�x�x�2�c�k�-�&@�#A�#A�A�A�(�*1�m�*1�*1�*1�2�2�2�
���
�.�.�.�!&�!1���W+	2�+	2�+	2�+	2�+	2�+	2�+	2�+	2�+	2�+	2�+	2����+	2�+	2�+	2�+	2�Z�t�T�"�"�"s�AF#�>DF#�#F'�*F'c�P�|�|��t||��dS)z/Trigger the load and then perform the deletion.N)ri�delattr)rYrrs  r�__delattr__z_LazyModule.__delattr__s.��	
���d�#�#�#���d�����rN)rL�
__module__�__qualname__�__doc__rir{�rrrbrb�s9������U�U�1#�1#�1#�f����rrbc�P�eZdZdZed���Zed���Zd�Zd�Z	d�Z
dS)�
LazyLoaderzKA loader that creates a module which defers loading until attribute access.c�D�t|d��std���dS)Nrnz loader must define exec_module())rM�	TypeError)rms r�__check_eager_loaderzLazyLoader.__check_eager_loader"s0���v�}�-�-�	@��>�?�?�?�	@�	@rc�<����������fd�S)z>Construct a callable which returns the eager loader made lazy.c�&����|i|����S�Nr)rNrO�clsrms  ��r�<lambda>z$LazyLoader.factory.<locals>.<lambda>+s ���s�s�6�6�4�+B�6�+B�+B�'C�'C�r)�_LazyLoader__check_eager_loader)r�rms``r�factoryzLazyLoader.factory's,����	� � ��(�(�(�C�C�C�C�C�Crc�>�|�|��||_dSr�)r�rm)rYrms  r�__init__zLazyLoader.__init__-s!���!�!�&�)�)�)�����rc�6�|j�|��Sr�)rm�
create_module)rYr+s  rr�zLazyLoader.create_module1s���{�(�(��.�.�.rc��|j|j_|j|_i}|j���|d<|j|d<t
j��|d<d|d<||j_t|_dS)zMake the module load lazily.rgrerdFrfN)
rmr%rXrg�copyre�	threading�RLockrjrb)rYr*rjs   rrnzLazyLoader.exec_module4sx��!%����� �K���
��#)�?�#7�#7�#9�#9��Z� �$*�$4��[�!�(��0�0��V��%*��\�"�'3���$�&����rN)rLr|r}r~�staticmethodr��classmethodr�r�r�rnrrrr�r�s�������U�U��@�@��\�@��D�D��[�D�
���/�/�/�'�'�'�'�'rr�r�)"r~�_abcr�
_bootstraprrrr�_bootstrap_externalrr	r
rrr
�
contextlibrrrSr#r�rprHrrr,r8r@rUr[r`rqrbr�rrr�<module>r�s��3�3�������(�(�(�(�(�(�%�%�%�%�%�%�(�(�(�(�(�(�"�"�"�"�"�"�-�-�-�-�-�-�2�2�2�2�2�2�2�2�2�2�2�2�.�.�.�.�.�.�2�2�2�2�2�2�8�8�8�8�8�8�%�%�%�%�%�%���������
�
�
�
�������������=�=�=�
7�7�7�����>*�*�*�*�Z�(�(���(�2���(���$%%�%%�%%�P<�<�<�<�<�%�"�<�<�<�~$'�$'�$'�$'�$'��$'�$'�$'�$'�$'r

Hacked By AnonymousFox1.0, Coded By AnonymousFox