python (3.11.7)
e>` d Z ddlmZ ddlmZ ddlZddlZddlZddl Z ddl
Z ddlZddlm
Z
ddlZg dZ edd Zd e_ d
Zd Zdd
Zd dZed!d Zd!dZe ej j e d Z G d d Z G d d Z ddlZddlmZ d!dZe ee n# e $ r Y nw xY wd Z!d!dZ"d Z#d Z$d Z%d Z&da'd Z(dS )"zUtilities to support packages. )
namedtuple)singledispatchN)
ModuleType)get_importeriter_importers
get_loaderfind_loader
walk_packagesiter_modulesget_dataImpImporter ImpLoader read_codeextend_path
ModuleInfor zmodule_finder name ispkgz.A namedtuple with minimal info about a module.c | j } || S # t $ r= | | }|Y dS t j || cY S w xY w)z'Return the finder-specific module spec.N) find_specAttributeErrorfind_module importlibutilspec_from_loader)findernamer loaders ;/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/pkgutil.py _get_specr sy $ y
= = =##D))>44~..tV<<<<< =s !A AAc dd l }| d }|t j j k rd S | d | | S )Nr )marshalreadr r MAGIC_NUMBERload)streamr! magics r r r ( sR NNNKKNNE +++t
KKOOO<< c # K i fdt | | D ]}|V |j r t |j t t
j |j dd pg } fd| D } t | |j dz | E d{V x# t $ r | ||j Y t $ r | ||j n Y w xY wdS )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 | |v rdS d|| <