o [d @s8ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z Gdddej Z GdddejZedkreZeed eiZd D] Zeeee<qOe eeZdad azddlZWn eyqYnweZd e_e zeWdSe ytrt!st"d aYq|wdS) N)futurescs$eZdZfddZddZZS)AsyncIOInteractiveConsolecs*t||jjjtjO_||_dS)N)super__init__compilecompilerflagsastPyCF_ALLOW_TOP_LEVEL_AWAITloop)selflocalsr  __class__'/usr/lib/python3.10/asyncio/__main__.pyrs  z"AsyncIOInteractiveConsole.__init__csntjfdd}t|zWStyty6tr/ dYdS YdSw)Nc sdadatj}z|}Wn8tyty1}zda|WYd}~dSd}~wtyH}z |WYd}~dSd}~wwt |sU |dSzj |attWdSty|}z |WYd}~dSd}~ww)NFT) repl_futurerepl_future_interruptedtypes FunctionTyper SystemExitKeyboardInterrupt set_exception BaseExceptioninspect iscoroutine set_resultr create_taskr _chain_future)funccoroexexccodefuturer rrcallbacks6       z3AsyncIOInteractiveConsole.runcode..callbackz KeyboardInterrupt ) concurrentrFuturer call_soon_threadsaferesultrrrwrite showtraceback)r r%r'rr$rruncodes     z!AsyncIOInteractiveConsole.runcode)__name__ __module__ __qualname__rr. __classcell__rrrrrs rc@seZdZddZdS) REPLThreadc Cstz*dtjdtjdttddd}tj|ddWtjd d td t t j dStjd d td t t j w) Nz asyncio REPL z on zy Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information. ps1z>>> zimport asynciozexiting asyncio REPL...)bannerexitmsgignorez ^coroutine .* was never awaited$)messagecategory) sysversionplatformgetattrconsoleinteractwarningsfilterwarningsRuntimeWarningr r*stop)r r5rrrrunFs* zREPLThread.runN)r/r0r1rDrrrrr3Ds r3__main__asyncio>__file__r/__spec__ __loader__ __package__ __builtins__FT)#r rFr%concurrent.futuresr(rr: threadingrr@rInteractiveConsolerThreadr3r/new_event_loopr set_event_loop repl_localskeyrr>rrreadline ImportError repl_threaddaemonstart run_foreverrdonecancelrrrrsP 6