Your IP : 3.129.195.82
U
e5d7, � @ s( d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm
Z
d d lmZ d d
lmZ d dlm
Z
dd
lmZ ddlZddlZddlZddlZddlZdd� Zdd� Zd#dd�Zd$dd�Zedd� �Zdd� Zdd� Zdd� ZG dd � d ej�ZG d!d"� d"ej�Z dS )%� )�abc)�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 C s t �t| �S �N)�_imp�source_hashr )�source_bytes� r �&/usr/lib64/python3.8/importlib/util.pyr s r c C s\ | � d�s| S |s&tdt| �� d���d}| D ]}|dkr> qH|d7 }q.t| |d � ||�S )N�.zno package specified for z% (required for relative module names)r
r )�
startswith�
ValueError�reprr )�name�package�level� characterr r r �resolve_name s
r c C sx | t jkrt| |�S t j| }|d kr*d S z
|j}W n$ tk
rX td�| ��d �Y nX |d krptd�| ���|S d S )N�{}.__spec__ is not set�{}.__spec__ is None)�sys�modulesr �__spec__�AttributeErrorr �format)r �path�module�specr r r �_find_spec_from_path* s
r( c
C s� | � d�rt| |�n| }|tjkr�|�d�d }|r�t|dgd�}z
|j}W q� tk
r� } ztd|�d|��|d�|�W 5 d }~X Y q�X nd }t ||�S tj| }|d kr�d S z
|j
}W n$ tk
r� td�| ��d �Y nX |d kr�td �| ���|S d S )
Nr r
�__path__)�fromlistz __path__ attribute not found on z while trying to find )r r r )
r r r r! �
rpartition�
__import__r) r# �ModuleNotFoundErrorr r"