
    h                     p   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n# e$ r Y nw xY w e            Zde_        e                                 	 	 e                                 dS # e $ r> t0          r4t0          !                                st0          "                                 daY Zw xY wdS )    N   )futuresc                   $     e Zd Z fdZd Z xZS )AsyncIOInteractiveConsolec                     t                                          |           | j        j        xj        t
          j        z  c_        || _        d S )N)super__init__compilecompilerflagsastPyCF_ALLOW_TOP_LEVEL_AWAITloop)selflocalsr   	__class__s      '/usr/lib/python3.11/asyncio/__main__.pyr	   z"AsyncIOInteractiveConsole.__init__   sB       ##s'EE##			    c                 L    t           j                                         fd}t                              |           	                                 S # t          $ r  t          $ r7 t          r 	                    d           Y d S  
                                 Y d S w xY w)Nc                  8   d a dat          j        j                  } 	  |             }na# t
          $ r  t          $ r"}da                    |           Y d }~d S d }~wt          $ r }                    |           Y d }~d S d }~ww xY wt          j
        |          s                    |           d S 	 j                            |          a t          j        t                      d S # t          $ r }                    |           Y d }~d S 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   sn    K&+#%dDK88D
tvv   $   *.'$$R(((    $$R((( &t,, !!$'''*"i33D99%k6:::::  * * *$$S)))))))))*s9   
, B
 AB
*BB
94C/ /
D9DDz
KeyboardInterrupt
)
concurrentr   Futurer   call_soon_threadsaferesultr   r   r   writeshowtraceback)r   r(   r*   r)   s   `` @r   runcodez!AsyncIOInteractiveConsole.runcode   s    #**,,	* 	* 	* 	* 	* 	* 	*< 	!!(+++	%==??" 	 	 	 	% 	% 	%& %

2333333""$$$$$$		%s   A 0B#B#"B#)__name__
__module____qualname__r	   r1   __classcell__)r   s   @r   r   r      sG            +% +% +% +% +% +% +%r   r   c                       e Zd Zd ZdS )
REPLThreadc           
         	 dt           j         dt           j         dt          t           dd           d}t                              |d           t          j        d	d
t                     t          
                    t          j                   d S # t          j        d	d
t                     t          
                    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? ? ? ? ? 3v..	? ? ?  1  3 3 3 #;') ) ) )
 %%di00000 #;') ) ) )
 %%di0000s   AB ACN)r2   r3   r4   rI    r   r   r7   r7   D   s#        1 1 1 1 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      s!   



        



            3% 3% 3% 3% 3% 7 3% 3% 3%l1 1 1 1 1! 1 1 10 z!7!##DG4   g&K, ) ) "688C=C''T::GK#    *,,KK		 E ! 	 	 	 /;#3#3#5#5 /""$$$*.'H		7 s%   #B( (B0/B0C0 0A D32D3