%PDF- %PDF-
Direktori : /usr/lib/python3.12/importlib/__pycache__/ |
Current File : //usr/lib/python3.12/importlib/__pycache__/util.cpython-312.pyc |
� ���fX* � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ dd lmZ ddlm Z ddlmZ d dlZd dlZd dlZd dlZd� Zd� Zdd�Zdd�Z G d� d� Z G d� dej0 � Z G d� de� Zy)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� Nc �6 � t j t | � S )zBReturn the hash of *source_bytes* as used in hash-based pyc files.)�_imp�source_hashr )�source_bytess �%/usr/lib/python3.12/importlib/util.pyr r s � ����-�|�<�<� c � � | j d� s| S |st dt | � � d�� �d}| D ] }|dk7 r n|dz }� t | |d ||� S )z2Resolve a relative module name to an absolute one.�.zno package specified for z% (required for relative module names)r r N)� startswith�ImportError�reprr )�name�package�level� characters r �resolve_namer s| � ��?�?�3���� ��5�d�4�j�\� BA� A� B� B� �E�� � ����� �� ��� ��e�f��w��6�6r c �� � | t j vrt | |� S t j | }|�y |j }|�t | � d�� �|S # t $ r t | � d�� d�w xY w)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�AttributeError)r �path�module�specs r �_find_spec_from_pathr* ( s� � � �3�;�;���$��%�%����T�"���>�� ��?�?�D� �|� �D�6�):�!;�<�<��K�� � F���v�%9�:�;��E� F�s �A �A-c �� � | j d� rt | |� n| }|t j vr@|j d� d }|rt |dg�� } |j }nd}t ||� S t j | }|�y |j }|�t | � d �� �|S # t $ r}t d|�d|��|�� |�d}~ww xY w# t $ r t | � d �� d�w xY w)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. r r �__path__)�fromlistz __path__ attribute not found on z while trying to find )r Nr r! )r r r"