_i ZddlZddlZGddZdZeeej y)NcNeZdZdZd dZedZdZdZdZ dZ d d Z d Z y) VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. Nch||_t||_|xs|jdd|_y)Nextern_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrr r s /builddir/build/BUILDROOT/alt-python312-setuptools-69.0.2-3.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pkg_resources/extern/__init__.py__init__zVendorImporter.__init__ s/"!.1$N (9(9(I(Nc#6K|jdzdyw)zL Search first the vendor package then as a natural package. .N)r r s r search_pathzVendorImporter.search_paths oo##sc|j|jdz\}}}| xr)tt|j|j S)z,Figure out if the target module is vendored.r) partitionranymap startswithr )r fullnamerootbasetargets r_module_matches_namespacez(VendorImporter._module_matches_namespacesG%//0DEdFxLCF$5$5t7J7J KLLrc@|j|jdz\}}}|jD]<} ||z}t|tj |}|tj |<|cSt djdit#t $rYmwxYw)zK Iterate over the search path to locate and load fullname. rzThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.) rrr __import__sysmodules ImportErrorformatlocals)r rrrrprefixextantmods r load_modulezVendorImporter.load_modules&//0DEdF&&F &6"kk&)(+ H% '' !'3*03   s7B BBc8|j|jSN)r+name)r specs r create_modulezVendorImporter.create_module3s **rcyr-r!)r modules r exec_modulezVendorImporter.exec_module6s rch|j|r tjj||SdS)z(Return a module spec for vendored names.N)r importlibutilspec_from_loader)r rpathrs r find_speczVendorImporter.find_spec9s7--h7 NN + +Hd ;  rch|tjvr tjj|yy)zR Install this importer into sys.meta_path if not already present. N)r# meta_pathappendrs rinstallzVendorImporter.installAs' s}} $ MM  & %r)r!N)NN) __name__ __module__ __qualname____doc__rpropertyrrr+r0r3r9r=r!rrrrs@ O M ,+  'rr) packaging platformdirsjaracoimportlib_resourcesmore_itertools)importlib.utilr5r#rnamesr>r=r!rrrJs4 A'A'H x'')r