o 0¦i~)ã@sª ddlZddlZddlmZmZgd¢ZGdd„dƒZGdd„deƒZddd „Ze d krSddl Z e   ¡Z e j d d d d�e  ¡ZejsHejjrKdZndZeeƒdSdS)éN)ÚCommandCompilerÚcompile_command)ÚInteractiveInterpreterÚInteractiveConsoleÚinteractrc@sDeZdZ ddd„Zddd„Zdd „Zdd d „Zd d „Zdd„ZdS)rNcCs& |dur dddœ}||_tƒ|_dS)NZ __console__)Ú__name__Ú__doc__)ÚlocalsrÚcompile)Úselfr ©r ú+/opt/alt/python310/lib64/python3.10/code.pyÚ__init__s   zInteractiveInterpreter.__init__úÚsinglec CsT z | |||¡}Wntttfy| |¡YdSw|dur#dS| |¡dS)NFT)r Ú OverflowErrorÚ SyntaxErrorÚ ValueErrorÚshowsyntaxerrorÚruncode)r ÚsourceÚfilenameZsymbolÚcoder r r Ú runsource&s ý z InteractiveInterpreter.runsourcecCs8 z t||jƒWdSty‚| ¡YdS©N)Úexecr Ú SystemExitÚ showtraceback)r rr r r rMs  zInteractiveInterpreter.runcodec Cs® t ¡\}}}|t_|t_|t_|r8|tur8z |j\}\}}}} Wn ty+Yn wt||||| fƒ}|t_tjtj urNt   ||¡} |  d  | ¡¡dSt |||¡dS)NÚ)ÚsysÚexc_infoÚ last_typeÚ last_valueÚlast_tracebackrÚargsrÚ excepthookÚ__excepthook__Ú tracebackÚformat_exception_onlyÚwriteÚjoin) r rÚtypeÚvalueÚtbÚmsgZdummy_filenameÚlinenoÚoffsetÚlineÚlinesr r r r`s"   þ  z&InteractiveInterpreter.showsyntaxerrorcCs’ t ¡\t_t_}}|t_z4t |d|d|j¡}tjtj ur+|  d  |¡¡nt |d|d|¡Wd}}dSWd}}dSd}}w)Nrér) rr r!r"r#r'Úformat_exceptionÚtb_nextr%r&r)r*)r Zlast_tbZeir2r r r rƒs  úz$InteractiveInterpreter.showtracebackcCs tj |¡dSr)rÚstderrr))r Údatar r r r)˜szInteractiveInterpreter.writer)rr) rÚ __module__Ú __qualname__rrrrrr)r r r r rs  ' # rc@s<eZdZ ddd„Zdd„Zddd„Zd d „Zdd d „ZdS)rNú cCs t ||¡||_| ¡dSr)rrrÚ resetbuffer)r r rr r r rªs  zInteractiveConsole.__init__cCs g|_dSr)Úbuffer)r r r r r;¸s zInteractiveConsole.resetbuffercCsH ztjWn tydt_YnwztjWn ty$dt_Ynwd}|dur;| dtjtj||jjf¡n |rF| dt |ƒ¡d} z'|rPtj}ntj}z|  |¡}Wnt yi| d¡YWnw|  |¡}Wnt y„| d ¡| ¡d}YnwqI|dur•| d |jj¡dS|d kr¢| d|¡dSdS) Nz>>> z... zFType "help", "copyright", "credits" or "license" for more information.zPython %s on %s %s (%s) z%s rr3Ú z KeyboardInterrupt znow exiting %s... r)rZps1ÚAttributeErrorZps2r)ÚversionÚplatformÚ __class__rÚstrÚ raw_inputÚEOFErrorÚpushÚKeyboardInterruptr;)r ÚbannerÚexitmsgZcprtÚmoreÚpromptr1r r r r¼sX   ÿ   ÿ ÿÿ  þ  ýóÿzInteractiveConsole.interactcCs8 |j |¡d |j¡}| ||j¡}|s| ¡|S)Nr=)r<Úappendr*rrr;)r r1rrIr r r rEòs zInteractiveConsole.pushrcCs t|ƒSr)Úinput)r rJr r r rCs zInteractiveConsole.raw_input)Nr:)NN)r)rr8r9rr;rrErCr r r r r¢s  6rcCsJ t|ƒ}|dur ||_nzddl}Wn tyYnw| ||¡dS)Nr)rrCÚreadlineÚ ImportErrorr)rGZreadfuncZlocalrHZconsolerMr r r rs  ÿrÚ__main__z-qÚ store_truez*don't print version and copyright messages)ÚactionÚhelpr)NNNN)rr'ZcodeoprrÚ__all__rrrrÚargparseÚArgumentParserÚparserÚ add_argumentÚ parse_argsr$ÚqÚflagsÚquietrGr r r r Ús* tÿ õ