
    4bh                     j   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
ddlmZ  G d dej                        Z G d dej                        Zedk(  r ej$                  d	        ej&                         Z ej*                  e       d
eiZdD ]  Z e       e   ee<     eee      Zdada	 d dlZ e       Zde_        ejA                          	 	 ejC                          yy# e$ r Y 9w xY w# e"$ r3 t4        r*t4        jG                         st4        jI                          daY Vw xY w)    N   )futuresc                   $     e Zd Z fdZd Z xZS )AsyncIOInteractiveConsolec                     t         |   |       | j                  j                  xj                  t
        j                  z  c_        || _        t        j                         | _
        y )N)super__init__compilecompilerflagsastPyCF_ALLOW_TOP_LEVEL_AWAITloopcontextvarscopy_contextcontext)selflocalsr   	__class__s      :/opt/python-3.12.12/usr/lib/python3.12/asyncio/__main__.pyr	   z"AsyncIOInteractiveConsole.__init__   sH     ##s'E'EE#	"//1    c                 8    t         j                  j                          fd}t        j	                  | j
                         	 j                         S # t        $ r  t        $ r, t        r j                  d       Y y  j                          Y y w xY w)Nc                  &   d a dat        j                  j                        } 	  |        }t        j                  |      sj                  |       y 	 j                  j                  |j                        a t        j                   t                y # t
        $ r  t        $ r}daj                  |       Y d }~y d }~wt        $ r}j                  |       Y d }~y d }~ww xY w# t        $ r}j                  |       Y d }~y d }~ww xY w)NFTr   )repl_futurerepl_future_interruptedtypesFunctionTyper   
SystemExitKeyboardInterruptset_exceptionBaseExceptioninspectiscoroutine
set_resultr   create_taskr   r   _chain_future)funccoroexexccodefuturer   s       r   callbackz3AsyncIOInteractiveConsole.runcode.<locals>.callback   s     K&+#%%dDKK8D
v &&t,!!$'*"ii33D$,,3O%%k6:!  $ *.'$$R(  $$R( ! *$$S))*s<   B AC, C)*CC)C$$C),	D5DDr   z
KeyboardInterrupt
)
concurrentr   Futurer   call_soon_threadsafer   resultr   r"   r   writeshowtraceback)r   r,   r.   r-   s   `` @r   runcodez!AsyncIOInteractiveConsole.runcode   s|    ##**,	*< 	!!(DLL!A	%==?" 	 	%&

23""$		%s   A )BBB)__name__
__module____qualname__r	   r5   __classcell__)r   s   @r   r   r      s    2+%r   r   c                       e Zd Zd Zy)
REPLThreadc           
         	 dt         j                   dt         j                   dt        t         dd       d}t        j                  |d       t        j                  d	d
t               t        j                  t        j                         y # t        j                  d	d
t               t        j                  t        j                         w xY w)Nzasyncio REPL z on zy
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
ps1z>>> zimport asynciozexiting asyncio REPL...)bannerexitmsgignorez ^coroutine .* was never awaited$)messagecategory)sysversionplatformgetattrconsoleinteractwarningsfilterwarningsRuntimeWarningr   r1   stop)r   r>   s     r   runzREPLThread.runG   s    	1}D ?* 3v./~	?  1  3 ##;')
 %%dii0 ##;')
 %%dii0s   AB ACN)r6   r7   r8   rM    r   r   r;   r;   E   s    1r   r;   __main__zcpython.run_stdinasyncio>   __file__r6   __spec__
__loader____package____builtins__FT)%r   rP   r,   concurrent.futuresr/   r   r#   rC   	threadingr   rI    r   InteractiveConsoler   Threadr;   r6   auditnew_event_loopr   set_event_looprepl_localskeyr   rG   r   r   readlineImportErrorrepl_threaddaemonstartrun_foreverr    donecancelrN   r   r   <module>rh      sP   
      
    3% 7 7 3%l1!! 10 zCII!"!7!!#DG4 g&K, "8C=C,
 (T:GK# ,KK
	 G &   ! 	;#3#3#5""$*.'		s$   9C/ C: /C76C7:5D21D2