Your IP : 18.191.120.103


Current Path : /opt/alt/python310/lib64/python3.10/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/importlib/__pycache__/_common.cpython-310.pyc

o

6��f��@s�ddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlmZm
Z
ddlmZeejefZdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zejdejd�dd��Zejdd��Ze�ej�ejdd���Z dS)�N)�Union�Any�Optional�)�ResourceReader�Traversable)�	wrap_speccCstt|��S)z3
    Get a Traversable resource from a package
    )�from_package�get_package)�package�r�8/opt/alt/python310/lib64/python3.10/importlib/_common.py�filessrcCs.t|�}tj�|�\}}|rt|�d���|S)z�Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    z must be only a file name)�str�os�path�split�
ValueError)rZstr_path�parent�	file_namerrr
�normalize_paths
rcCs*|j}t|jdd�}|durdS||j�S)z?
    Return the package's loader if it's a ResourceReader.
    �get_resource_readerN)�__spec__�getattr�loader�name�r�spec�readerrrr
r&s


rcCst|tj�r|St�|�S)N)�
isinstance�types�
ModuleType�	importlib�
import_module)Zcandrrr
�resolve7sr$cCs(t|�}t|�jdurt|�d���|S)z�Take a package name or module object and return the module.

    Raise an exception if the resolved module is not a package.
    Nz is not a package)r$r�submodule_search_locations�	TypeError)rZresolvedrrr
r
<sr
cCst|�}|j�|j�}|��S)z=
    Return a Traversable object for the given package.

    )rrrrrrrrr
r	Hsr	�)�
_os_removeccs��tj|d�\}}z&t�||��t�|�~t�|�VWz||�WdSty/YdSwz||�Wwty?Yww)N��suffix)�tempfileZmkstempr�write�close�pathlib�Path�FileNotFoundError)rr*r(�fdZraw_pathrrr
�	_tempfileRs"�
���r2cCst|j|jd�S)zu
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    r))r2Z
read_bytesr�rrrr
�as_filegsr4ccs�|VdS)z7
    Degenerate behavior for pathlib.Path objects.
    Nrr3rrr
�_ps�
r5)r')!rr.r+�	functools�
contextlibr r"�typingrrr�abcrrZ	_adaptersrr!rZPackagerrrr$r
r	�contextmanager�remover2�singledispatchr4�registerr/r5rrrr
�<module>s4

�



?>