o bc4@s@dZddlmZddlmZmZiddddddd d d d d ddddddddddddddddddddd d!d"id#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdDdEdFdGdHdIdJdJdJdKdLdLdMdNdOZdPdQZefdRdSZGdTdUdUej Z dVS)Wz/Fix incompatible imports and module references.) fixer_base)Name attr_chainStringIOio cStringIOcPicklepickle __builtin__builtinscopy_regcopyregQueuequeue SocketServer socketserver ConfigParser configparserreprreprlib FileDialogztkinter.filedialog tkFileDialog SimpleDialogztkinter.simpledialogtkSimpleDialogtkColorChooserztkinter.colorchoosertkCommonDialogztkinter.commondialogDialogztkinter.dialogTkdndz tkinter.dndtkFontz tkinter.font tkMessageBoxztkinter.messagebox ScrolledTextztkinter.scrolledtext Tkconstantsztkinter.constantsTixz tkinter.tixttkz tkinter.ttkTkintertkinter markupbase _markupbase_winregwinregthread_thread dummy_thread _dummy_threaddbhashzdbm.bsddumbdbmzdbm.dumbdbmzdbm.ndbmgdbmzdbm.gnu xmlrpclibz xmlrpc.clientDocXMLRPCServerz xmlrpc.serverz http.clientz html.entitiesz html.parserz http.cookieszhttp.cookiejarz http.server subprocess collectionsz urllib.parsezurllib.robotparser)SimpleXMLRPCServerhttplibhtmlentitydefs HTMLParserCookie cookielibBaseHTTPServerSimpleHTTPServer CGIHTTPServercommands UserStringUserListurlparse robotparsercCsddtt|dS)N(|))joinmapr)membersrJ0/usr/lib/python3.10/lib2to3/fixes/fix_imports.py alternates=srLccsVddd|D}t|}d||fVd|Vd||fVd|VdS)Nz | cSsg|]}d|qS)zmodule_name='%s'rJ).0keyrJrJrK Bsz!build_pattern..zyname_import=import_name< 'import' ((%s) | multiple_imports=dotted_as_names< any* (%s) any* >) > zimport_from< 'from' (%s) 'import' ['('] ( any | import_as_name< any 'as' any > | import_as_names< any* >) [')'] > zimport_name< 'import' (dotted_as_name< (%s) 'as' any > | multiple_imports=dotted_as_names< any* dotted_as_name< (%s) 'as' any > any* >) > z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rGrLkeys)mappingmod_list bare_namesrJrJrK build_patternAs rTcsTeZdZdZdZeZdZddZfddZ fddZ fd d Z d d Z Z S) FixImportsTcCsdt|jS)NrE)rGrTrQselfrJrJrKrT`szFixImports.build_patterncs||_tt|dSN)rTPATTERNsuperrUcompile_patternrW __class__rJrKr\cs zFixImports.compile_patterncsHtt|j|}|r"d|vr tfddt|dDr dS|SdS)Nbare_with_attrc3s|]}|VqdSrYrJ)rMobjmatchrJrK qsz#FixImports.match..parentF)r[rUrbanyr)rXnoderesultsr]rarKrbjs zFixImports.matchcstt|||i|_dSrY)r[rU start_treereplace)rXtreefilenamer]rJrKrhvs zFixImports.start_treecCs|d}|r9|j}|j|}|t||jdd|vr"||j|<d|vr5||}|r7|||dSdSdS|dd}|j|j}|rT|t||jddSdS)N module_name)prefix name_importmultiple_importsr_)getvaluerQrirrmrb transform)rXrfrg import_modmod_namenew_name bare_namerJrJrKrszs$     zFixImports.transform)__name__ __module__ __qualname__ BM_compatiblekeep_line_orderMAPPINGrQ run_orderrTr\rbrhrs __classcell__rJrJr]rKrUUs   rUN) __doc__r fixer_utilrrr}rLrTBaseFixrUrJrJrJrKs       !"#5