xj ddlmZddlZddlZddlZddlZddlZddlmZddl m Z dgZ GddejjZGdd ejjZd d Zd d Zy)) annotationsN)Sequence) ModuleType alias_httpxc0eZdZUded<ddZddZd dZy) _AliasLoader%importlib.machinery.ModuleSpec | None_original_specc||_yN) _real_name)self real_names a/mnt/ssd/data/Dropbox/adrian/sandbox/mcp-query/venv/lib/python3.12/site-packages/httpx2/_alias.py__init__z_AliasLoader.__init__s #cftj|j}|j|_|Sr ) importlib import_moduler __spec__r )rspecmodules r create_modulez_AliasLoader.create_modules'((9$oo rc&|j|_yr )r r)rrs r exec_modulez_AliasLoader.exec_modules--rN)rstrreturnNone)rzimportlib.machinery.ModuleSpecrr)rrrr)__name__ __module__ __qualname____annotations__rrrrrrrs99$ .rrc0eZdZddZ d ddZy) _AliasFinderc ||_||_yr )_alias_real)raliasreals rrz_AliasFinder.__init__s  rNcd||jk7r|j|jdzsy|j|j|jz}|tj vr t jj|yt jj|t|S)N.) r' startswithr( removeprefixsysmodulesrutil find_spec machinery ModuleSpecr)rfullnamepathtargetrs rr2z_AliasFinder.find_spec"s t{{ "8+>+>t{{S?P+QJJ!6!6t{{!CC CKK 'INN,D,DY,O,W""--h Y8OPPr)r)rr*rrr)NN)r5rr6zSequence[str] | Noner7zModuleType | Nonerr )rr r!rr2r#rrr%r%s?&*$( Q Q# Q" Q / Qrr%cDtjj}|||urtddt fdtj Ds4tj j dt|j|tj<y)Nz? was already imported; call `alias_httpx()` before any `import z`.c3`K|]%}t|txr|jk('ywr ) isinstancer%r').0finderr)s r z_alias..5s)gvz&,/JFMMU4JJgs+.r) r/r0get RuntimeErrorany meta_pathinsertr%r)r)rexistings` rr'r'0s{{u%H 6eW$cdicjjlmnn gY\YfYfg g Q UFOO DECKKrcDddl}ddl}td|td|y)az Make `import httpx` resolve to `httpx2`, and `import httpcore` to `httpcore2`, process-wide. Intended for applications migrating from `httpx`, so that dependencies still importing `httpx` or `httpcore` share the `httpx2` classes. Libraries should never call this. Must be called before anything imports `httpx` or `httpcore`. Calling it again is a no-op. rNhttpxhttpcore) httpcore2httpx2r')rGrHs rrr:s 7F :y!r)r)rrrrr)rr) __future__rr importlib.abcimportlib.machineryimportlib.utilr/collections.abcrtypesr__all__abcLoaderrMetaPathFinderr%r'rr#rrrSs\" $ / .9=='' .Q9==//Q&  "r