Your IP : 3.135.195.180


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/pkgutil.cpython-39.opt-2.pyc

a

R�f�^�@s�ddlmZddlmZddlZddlZddlZddlZddl	Zddl
Z
ddlZddlm
Z
ddlZgd�Zedd�Zde_d	d
�Zdd�Zd1dd�Zd2dd�Zed3dd��Zd4dd�Ze�ejje�dd�ZGdd�d�ZGdd�d�Zz.ddlZddlmZd5dd�Z e�ee �Wne!�y.Yn0dd �Z"d6d!d"�Z#d#d$�Z$d%d&�Z%d'd(�Z&d)d*�Z'd+Z(e
�)d,e(�d-e(�d.�e
j*�Z+[(d/d0�Z,dS)7�)�
namedtuple)�singledispatchN)�
ModuleType)�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInforzmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsPz
|j}Wn8tyB|�|�}|dur0YdStj�||�YS0||�SdS�N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�,/opt/alt/python39/lib64/python3.9/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr �magicrrrr)s

r�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnJtyX|durT||j�Yqty~|durx||j�n�Yq0ttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)NcSs||vrdSd||<dS)NTr)�p�mrrr�seenSszwalk_packages.<locals>.seen�__path__csg|]}�|�s|�qSrr)�.0r'�r)rr�
<listcomp>j�z!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr,rr	6s r	ccsr|durt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||vrDd||<t|||�VqDq6dS)Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r7r8Z	importers�yielded�irr0rrrr
os



r
cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr8rrrr@�s
r@c	cs |jdustj�|j�sdSi}ddl}zt�|j�}WntyNg}Yn0|��|D]�}|�|�}|dks\||vr|q\tj�|j|�}d}|s�tj�|�r�d|vr�|}zt�|�}	Wnty�g}	Yn0|	D]}|�|�}
|
dkr�d}q�q�q\|r\d|vr\d||<|||fVq\dS�Nr�__init__Fr/Tr;�	r7�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rDr8rArJ�	filenames�fn�modnamer7r0�dircontents�subnamerrr�_iter_file_finder_modules�s<



rUcCsBt���&t�dt�t�d�aWd�n1s40YdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerWrrrr�_import_imp�s
r]c@s*eZdZd	dd�Zd
dd�Zddd�ZdS)rNcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rX�warnr[r]r7)�selfr7rrrrF�s
�zImpImporter.__init__cCs~|�d�d}||kr$|jdur$dS|jdur4d}ntj�|j�g}zt�||�\}}}WntynYdS0t||||�S)Nr/���)�splitr7rH�realpathrWrr2r
)r`�fullnamer7rT�file�filename�etcrrrr�s
zImpImporter.find_moduler&c	cs |jdustj�|j�sdSi}ddl}zt�|j�}WntyNg}Yn0|��|D]�}|�|�}|dks\||vr|q\tj�|j|�}d}|s�tj�|�r�d|vr�|}zt�|�}	Wnty�g}	Yn0|	D]}|�|�}
|
dkr�d}q�q�q\|r\d|vr\d||<|||fVq\dSrErG)r`r8rArJrPrQrRr7r0rSrTrrrr
�s<



zImpImporter.iter_modules)N)N)r&)�__name__�
__module__�__qualname__rFrr
rrrrr�s

rc@sjeZdZdZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
ddd�ZdS)r
NcCs.t�dt�t�||_||_||_||_dSr^)rXr_r[r]rerfrdrg)r`rdrerfrgrrrrFs�zImpLoader.__init__cCsJ|��z*t�||j|j|j�}W|jrF|j��n|jrD|j��0|Sr)�_reopenrW�load_modulererfrg�close)r`rd�modrrrrls�zImpLoader.load_modulecCs6t|d��}|��Wd�S1s(0YdS)N�rb)�openr!)r`�pathnamererrrr&szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfvrPt|jd�|_dS)N��rro)	re�closedrgrW�	PY_SOURCErprf�PY_COMPILED�C_EXTENSION)r`�mod_typerrrrk*s

zImpLoader._reopencCs0|dur|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rdr2�r`rdrrr�	_fix_name2s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrr)rzrgrW�
PKG_DIRECTORYryrrr�
is_package:s
zImpLoader.is_packagecCs�|�|�}|jdur�|jd}|tjkrD|�|�}t||jd�|_nT|tjkr�|�	�zt
|j�|_W|j��q�|j��0n|tj
kr�|����|_|jS)Nrr�exec)rz�codergrWru�
get_source�compilerfrvrkrrermr|�
_get_delegate�get_code)r`rdrx�sourcerrrr�>s






zImpLoader.get_codecCs�|�|�}|jdur�|jd}|tjkrZ|��z|j��|_W|j��q�|j��0nx|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_Wd�q�1s�0Yn|tjkr�|����|_|jS)Nrrrars)rzr�rgrWrurkrer!rmrvrHr7�existsrfrpr|r�r�)r`rdrx�frrrr�Os




*
zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrF)rrfrr)r`r�specrrrr�as

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfvrD|j	SdSr{)
rzrgrWr|r��get_filenamerurvrwrf)r`rdrxrrrr�fs


zImpLoader.get_filename)N)N)N)rhrirjrr�rFrlrrkrzr}r�r�r�r�rrrrr

s	

r
)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|vr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|vr.||vr.d||<||dfVq.dS)	Nrrrr;z__init__.pyTrFr/F)�sorted�	zipimport�_zip_directory_cache�archiver8�lenrJ�
startswithrbrH�seprN)	rDr8Zdirlist�_prefixZplenrArJrQrRrrr�iter_zipimport_modulests*
r�cCstt�|�}ztj|}WnVtyntjD]8}z ||�}tj�||�WqjWq,tybYq,0q,d}Yn0|Sr)rH�fsdecoder5�path_importer_cache�KeyError�
path_hooks�
setdefaultr2)Z	path_itemrD�	path_hookrrrr�s	



rccs�|�d�rd�|�}t|��d|vrV|�d�d}t�|�}t|dd�}|durhdSntjEdHtj	}|D]}t
|�VqldS)Nr/�'Relative module name {!r} not supportedrr*)r��formatr2�
rpartitionrr\r4r5�	meta_pathr7r)rd�msgZpkg_name�pkgr7�itemrrrr�s


rcCsn|tjvr tj|}|dur dSt|t�rb|}t|dd�}|durF|St|dd�durZdS|j}n|}t|�S)N�
__loader__�__spec__)r5r6r<rr4rhr)Zmodule_or_name�modulerrdrrrr�s


rcCs�|�d�rd�|�}t|��ztj�|�}WnHttttfyt}z(d}t|�|t	|�|��|�WYd}~n
d}~00|dur�|j
SdS)Nr/r�z,Error while finding loader for {!r} ({}: {}))r�r�r2rrrr�	TypeErrorr>�typer)rdr�r�Zexrrrr�s

.rcCs�t|t�s|S|d}|dd�}|�d�\}}}|rdztj|j}Wqjttfy`|YS0ntj}|D�]>}t|t	�s�qnt
|�}|dur�g}	t|d�r�|�|�}
|
dur�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||vr�|�|�q�tj�||�}tj�|�rnzt|�}
Wn:t�yP}z tj�d||f�WYd}~qnd}~00|
�F|
D]0}|�d�}|�r\|�d��r��q\|�|��q\Wd�qn1�s�0Yqn|S)Nz.pkgr/rrzCan't open %s: %s
�
�#)r<�listr�r5r6r*r�rr7r=rrCr�submodule_search_locationsr�appendrHrO�isfilerprL�stderr�write�rstripr�)r7rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
0rcCs�tj�|�}|durdS|j}|dus0t|d�s4dStj�|�pJtj�	|�}|dus^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)Nr�__file__�/r)rrrrrCr5r6�get�
_bootstrap�_loadrb�insertrHr7�dirnamer�rOr)�package�resourcer�rrn�partsZ
resource_namerrrrWs
�
rz(?!\d)(\w+)(\.(?!\d)(\w+))*z	^(?P<pkg>z)(?P<cln>:(?P<obj>z)?)?$c	Cs�t�|�}|std|����|��}|�d�rZt�|d�}|�d�}|rT|�d�ng}nn|�d�}|�d�}t�|�}|r�|d}|�d|��}zt�|�}|�d�|}Wqxt	y�Yq�Yqx0qx|}|D]}t
||�}q�|S)Nzinvalid format: Zclnr��objr/r)�
_NAME_PATTERN�matchr>�	groupdictr�rr\rb�popr2r4)	rr(Zgdrnr�rRr'�s�resultrrr�resolve_name�s0 







r�)Nr&N)Nr&)r&)r&)r&)r&)-�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrHZos.path�rer5�typesrrX�__all__r�__doc__rrr	r
r@rU�register�	machinery�
FileFinderr]rr
r�r�r�r2rrrrrrZ
_DOTTED_WORDSr��Ur�r�rrrr�<module>sV

9

(�Jc

^+

?>