*jiG S r SSKJr SSKJr SSKrSSKrSSKrSSK r SSK
r SSKrSSKJ
r
SSKr/ SQr\" SS5 rS \l S
rSS jrSS jr\SS
j5 rSS jr\R- \R. R0 \5 SSKrSSKJr SS jr\R- \\5 S rSS jrS rS r S r!S r"Sq#S r$g! \ a N"f = f)zUtilities to support packages. )
namedtuple)singledispatchN)
ModuleType)
get_importeriter_importers
get_loaderfind_loader
walk_packagesiter_modulesget_data read_codeextend_path
ModuleInfor zmodule_finder name ispkgz.A namedtuple with minimal info about a module.c SS K nU R S5 nU[ R R :w a g U R S5 UR U 5 $ )Nr )marshalread importlibutilMAGIC_NUMBERload)streamr magics ./opt/alt/python313/lib64/python3.13/pkgutil.pyr
r
sC KKNE +++
KKO<< c # # 0 4S jn[ X5 H nUv UR ( d M [ UR 5 [ [
R UR SS5 =( d / n U Vs/ s H oS" U5 ( a M UPM n n[ XR S- U5 Sh vN M gs snf N! [ a Ub U" UR 5 M M [ a Ub U" UR 5 M e f = f7f)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 X; a gSX' g )NT )pms r seenwalk_packages.