
    Rh                     >   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"                         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j=                          	 	 ej?                          yy# e$ r Y 9w xY w# e $ r3 t0        r*t0        jC                         st0        jE                          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_        || _        y )N)super__init__compilecompilerflagsastPyCF_ALLOW_TOP_LEVEL_AWAITloop)selflocalsr   	__class__s      '/usr/lib/python3.12/asyncio/__main__.pyr	   z"AsyncIOInteractiveConsole.__init__   s8     ##s'E'EE#	    c                      t         j                  j                          fd}t        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                  |      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)repl_futurerepl_future_interruptedtypesFunctionTyper   
SystemExitKeyboardInterruptset_exceptionBaseExceptioninspectiscoroutine
set_resultr   create_taskr   _chain_future)funccoroexexccodefuturer   s       r   callbackz3AsyncIOInteractiveConsole.runcode.<locals>.callback   s     K&+#%%dDKK8D
v &&t,!!$'*"ii33D9%%k6:!  $ *.'$$R(  $$R( ! *$$S))*s;   B 5C  CB66CCC 	D)C??Dz
KeyboardInterrupt
)
concurrentr   Futurer   call_soon_threadsaferesultr   r   r   writeshowtraceback)r   r(   r*   r)   s   `` @r   runcodez!AsyncIOInteractiveConsole.runcode   ss    ##**,	*< 	!!(+	%==?" 	 	%&

23""$		%s   A )B:BB)__name__
__module____qualname__r	   r1   __classcell__)r   s   @r   r   r      s    +%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   r-   stop)r   r:   s     r   runzREPLThread.runF   s    	1}D ?* 3v./~	?  1  3 ##;')
 %%dii0 ##;')
 %%dii0s   AB ACN)r2   r3   r4   rI    r   r   r7   r7   D   s    1r   r7   __main__asyncio>   __file__r2   __spec__
__loader____package____builtins__FT)#r   rL   r(   concurrent.futuresr+   r   r?   	threadingr   rE    r   InteractiveConsoler   Threadr7   r2   new_event_loopr   set_event_looprepl_localskeyr   rC   r   r   readlineImportErrorrepl_threaddaemonstartrun_foreverr   donecancelrJ   r   r   <module>rc      sC   
     
    3% 7 7 3%l1!! 10 z!7!!#DG4 g&K, ) "8C=C)
 (T:GK# ,KK
	 C "   ! 	;#3#3#5""$*.'		s$   #C C$ C! C!$5DD