관리-도구
편집 파일: pkgutil.cpython-310.pyc
o 6��f ` � @ sl d Z ddlmZ ddlmZ ddlZddlZddlZddl Z ddl Z ddlZddlm Z ddlZg d�Zedd�Zd e_ d d� Zdd � Zd.dd�Zd/dd�Zed0dd��Zd0dd�Ze�ejje� dd� ZG dd� d�ZG dd� d�ZzddlZddlmZ d0dd�Ze�ee� W n e y� Y nw d d!� Z!d0d"d#�Z"d$d%� Z#d&d'� Z$d(d)� Z%d*d+� Z&da'd,d-� Z(dS )1zUtilities to support packages.� )� namedtuple)�singledispatchN)� ModuleType)�get_importer�iter_importers� get_loader�find_loader� walk_packages�iter_modules�get_data�ImpImporter� ImpLoader� read_code�extend_path� ModuleInfor zmodule_finder name ispkgz.A namedtuple with minimal info about a module.c C sJ z| j }W ||�S ty$ | �|�}|du rY dS tj�||� Y S w )z'Return the finder-specific module spec.N)� find_spec�AttributeError�find_module� importlib�util�spec_from_loader)�finder�namer �loader� r �./opt/alt/python310/lib64/python3.10/pkgutil.py� _get_spec s � �r c C s6 dd l }| �d�}|tjjkrd S | �d� |�| �S )Nr � � )�marshal�readr r �MAGIC_NUMBER�load)�streamr �magicr r r r ( s r � c # s� � i fdd�� t | |�D ]V}|V |jrbzt|j� W n% ty- |dur+||j� Y q ty@ |dur=||j� n� Y qw ttj|j dd�pLg } � fdd�| D �} t | |jd |�E dH qdS )a� Yields ModuleInfo for all modules recursively on path, or, if path is None, all accessible modules. 'path' should be either None or a list of paths to look for modules in. 'prefix' is a string to output on the front of every module name on output. Note that this function must import all *packages* (NOT all modules!) on the given path, in order to access the __path__ attribute to find submodules. 'onerror' is a function which gets called with one argument (the name of the package which was being imported) if any exception occurs while trying to import a package. If no onerror function is supplied, ImportErrors are caught and ignored, while all other exceptions are propagated, terminating the search. Examples: # list all modules python can access walk_packages() # list all submodules of ctypes walk_packages(ctypes.__path__, ctypes.__name__+'.') c S s | |v rdS d|| <