tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Y\¬Qc@ssdZddlmZmZddlmZddlmZmZm    Z    m
Z
m Z m Z m Z iddddd    d
d d d gfddddddddddddddddgfddgfgd 6dd
d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7gfdd8d9gfgd:6Zed:jed d;ƒd<„Zd=efd>„ƒYZd?S(@s¾Fix changes imports of urllib which are now incompatible.
   This is rather similar to fix_imports, but because of the more
   complex nature of the fixing for urllib, it has its own fixer.
iÿÿÿÿ(t
alternatest
FixImports(t
fixer_base(tNametCommat
FromImporttNewlinetfind_indentationtNodetsymssurllib.requestt    URLopenertFancyURLopenert urlretrievet
_urlopenerturlopent
urlcleanupt pathname2urlt url2pathnames urllib.parsetquotet
quote_plustunquotet unquote_plust    urlencodet    splitattrt    splithostt
splitnportt splitpasswdt    splitportt
splitquerytsplittagt    splittypet    splitusert
splitvalues urllib.errortContentTooShortErrorturllibtinstall_openert build_openertRequesttOpenerDirectort BaseHandlertHTTPDefaultErrorHandlertHTTPRedirectHandlertHTTPCookieProcessort ProxyHandlertHTTPPasswordMgrtHTTPPasswordMgrWithDefaultRealmtAbstractBasicAuthHandlertHTTPBasicAuthHandlertProxyBasicAuthHandlertAbstractDigestAuthHandlertHTTPDigestAuthHandlertProxyDigestAuthHandlert HTTPHandlert HTTPSHandlert FileHandlert
FTPHandlertCacheFTPHandlertUnknownHandlertURLErrort    HTTPErrorturllib2iccs•tƒ}x…tjƒD]w\}}xh|D]`}|\}}t|ƒ}d||fVd|||fVd|Vd|Vd||fVq)WqWdS(Nsimport_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  sÆimport_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  sIimport_from< 'from' module_star=%r 'import' star='*' >
                  stimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  sKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  (tsettMAPPINGtitemsR(tbaret
old_moduletchangestchanget
new_moduletmembers((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyt build_pattern1s               t    FixUrllibcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsdjtƒƒS(Nt|(tjoinRF(tself((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyRFJscCs™|jdƒ}|j}g}x?t|jd D],}|jt|dd|ƒtƒgƒq0W|jtt|jddd|ƒƒ|j|ƒdS(s‘Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        tmoduleiÿÿÿÿitprefixN(    tgetRLR>tvaluetextendRRtappendtreplace(RJtnodetresultst
import_modtpreftnamestname((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyttransform_importMs    *(cCsð|jdƒ}|j}|jdƒ}|r½t|tƒrI|d}nd }x6t|jD]'}|j|dkr]|d}Pq]q]W|rª|jt|d|ƒƒqì|j    |dƒn/g}i}    |d}
xÍ|
D]Å}|j
t j kr|j dj} |j dj} n|j} d } | d    krÚxlt|jD]Z}| |dkr>|d|    krx|j|dƒn|    j|dgƒj|ƒq>q>WqÚqÚWg} t|ƒ}t}d
„}x½|D]µ}|    |}g}x8|d  D],}|j|||ƒƒ|jtƒƒqìW|j||d |ƒƒt||ƒ}| sa|jjj|ƒrm||_n| j|ƒt}qËW| rÜg}x(| d  D]}|j|tƒgƒq›W|j| d ƒ|j|ƒn|j    |d ƒd S(sšTransform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        t
mod_membertmemberiiRLs!This is an invalid module elementREiu,cSsz|jtjkrdt|jdjd|ƒ|jdjƒ|jdjƒg}ttj|ƒgSt|jd|ƒgS(NiRLii(ttypeR    timport_as_nameRtchildrenRNtcloneR(RWRLtkids((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyt handle_names iÿÿÿÿsAll module elements are invalidN(RMRLt
isinstancetlisttNoneR>RNRQRtcannot_convertR[R    R\R]RPt
setdefaultRtTrueRORRtparenttendswithtFalseR(RJRRRSRYRURZtnew_nameRCtmodulestmod_dictREtas_namet member_namet    new_nodest indentationtfirstR`RKteltsRVtelttnewtnodestnew_node((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyttransform_member]sh     
 
      +      
 
cCs²|jdƒ}|jdƒ}d}t|tƒr@|d}nx6t|jD]'}|j|dkrN|d}PqNqNW|rž|jt|d|jƒƒn|j    |dƒdS(s.Transform for calls to module members in code.tbare_with_attrRZiiRLs!This is an invalid module elementN(
RMRcRaRbR>RNRQRRLRd(RJRRRSt
module_dotRZRjRC((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyt transform_dot©s 
cCs®|jdƒr"|j||ƒnˆ|jdƒrD|j||ƒnf|jdƒrf|j||ƒnD|jdƒrˆ|j|dƒn"|jdƒrª|j|dƒndS(NRKRYRxt module_starsCannot handle star imports.t    module_ass#This module is now multiple modules(RMRXRwRzRd(RJRRRS((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyt    transformºs(t__name__t
__module__RFRXRwRzR}(((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyRGHs
            L    N(t__doc__tlib2to3.fixes.fix_importsRRtlib2to3Rtlib2to3.fixer_utilRRRRRRR    R>RPRFRG(((s`/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_urllib.pyt<module>sD4