File: D:/Python311/Lib/importlib/resources/__pycache__/_common.cpython-311.opt-1.pyc
�
��Vc� � �X � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZm Z ddl
mZmZ ddl
mZ eej ef Zd� Zd� Zd� Zd � Zd
� Zej de j d�d
�� � Zej d� � � Ze� ej � � ej d� � � � � ZdS )� N)�Union�Optional� )�ResourceReader�Traversable)� wrap_specc �: � t t | � � � � S )z3
Get a Traversable resource from a package
)�from_package�get_package)�packages �/D:\Python311\Lib\importlib\resources\_common.py�filesr s � �
��G�,�,�-�-�-� c �d � | j }t |j dd� � }|�dS ||j � � S )z?
Return the package's loader if it's a ResourceReader.
�get_resource_readerN)�__spec__�getattr�loader�name�r �spec�readers r
r r s? � � ��D�
�T�[�"7��
>�
>�F�
� ��t��6�$�)���r c �b � t | t j � � r| nt j | � � S )N)�
isinstance�types�
ModuleType� importlib�
import_module)�cands r
�resolver * s* � ��d�E�$4�5�5�X�4�4�9�;R�SW�;X�;X�Xr c �p � t | � � }t |� � j �t | �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)r �resolveds r
r r / s@ � � �w���H�����5� 9��7�7�7�7�8�8�8��Or c � � t | � � }|j � |j � � }|� � � S )z=
Return a Traversable object for the given package.
)r r r r r r s r
r
r
; s6 � �
�W���D�
�[�
,�
,�T�Y�
7�
7�F��<�<�>�>�r � )�
_os_removec # �~ K � t j |�� � \ }} t j | | � � � � t j |� � n# t j |� � w xY w~ t j |� � V � ||� � d S # t $ r Y d S w xY w# ||� � w # t $ r Y w w xY wxY w)N��suffix)�tempfile�mkstemp�os�write�close�pathlib�Path�FileNotFoundError)r r* r'