관리-도구
편집 파일: _common.cpython-38.pyc
U +�eQ � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl mZmZm Z ddlmZmZ ddlmZ eejef ZeZdd� Zed,ee ed�d d ��Zejee d�dd �Zejee ejd�dd��Zejeejd�dd��Zejdejd�dd��Zdd� Zejd�dd�Zej d-e j!d�dd��Z"dd� Z#ee$d�d d!�Z%ejd"d#� �Z&e&�ej'�ej d$d� ��Zej ej(d%�d&d'��Z)ej d(d)� �Z*d*d+� Z+dS ).� N)�Union�Optional�cast� )�ResourceReader�Traversable)� wrap_specc s( t � �t�� ���f� �fdd� �}|S )a Replace 'package' parameter as 'anchor' and warn about the change. Other errors should fall through. >>> files('a', 'b') Traceback (most recent call last): TypeError: files() takes from 0 to 1 positional arguments but 2 were given c sH |�k r2| �k r� | |�S t jdtdd� � |�S | �kr@� � S � | �S )Nz/First parameter to files is renamed to 'anchor'� )� stacklevel)�warnings�warn�DeprecationWarning)�anchor�package��func� undefined� �I/opt/hc_python/lib/python3.8/site-packages/importlib_resources/_common.py�wrapper! s �z"package_to_anchor.<locals>.wrapper)�object� functools�wraps)r r r r r �package_to_anchor s r )r �returnc C s t t| ��S )z3 Get a Traversable resource for an anchor. )�from_package�resolve)r r r r �files3 s r )r r c C s* | j }t|jdd�}|dkr dS ||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 r )�candr c C s t tj| �S �N)r �types� ModuleType�r&