
    g@                        d dl m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	 d dl
Z
d dlZd dlZd dlmZ e G d de	             Zd	dZd
dZy)    )annotationsN)InteractiveConsole)finalc                  6     e Zd ZU ded<   dd fdZddZ xZS )TrioInteractiveConsoledict[str, object]localsc                    t         |   |       | j                  j                  xj                  t
        j                  z  c_        y )N)r	   )super__init__compilecompilerflagsastPyCF_ALLOW_TOP_LEVEL_AWAIT)selfrepl_locals	__class__s     =/var/www/html/venv/lib/python3.12/site-packages/trio/_repl.pyr   zTrioInteractiveConsole.__init__   s4    ,##s'E'EE#    c                "   t        j                  || j                        }t        j                  |      r/t
        j                  j                  t        j                  |      }n.t
        j                  j                  t        j                  |      }t        |t        j                        rt        |j                  t              r|j                  t!        |j                        |j                  ct"        _        t"        _        |j                  j(                  t"        _        t"        j,                  dk\  r|j                  t"        _        t#        j0                  t"        j$                  t"        j&                  t"        j*                         y y )N)      )typesFunctionTyper	   inspectiscoroutinefunctiontriofrom_threadrunoutcomeacapturerun_synccapture
isinstanceErrorerror
SystemExittypesys	last_type
last_value__traceback__last_tracebackversion_infolast_exc
excepthook)r   codefuncresults       r   runcodezTrioInteractiveConsole.runcode   s    !!$4&&t,%%))'*:*:DAF%%..wEFfgmm, &,,
3ll"
 15V\\0BFLL-s~%+\\%?%?"##w.#)<<CL s}}cnnc>P>PQ) -r   )N)r   zdict[str, object] | NonereturnNone)r2   ztypes.CodeTyper6   r7   )__name__
__module____qualname____annotations__r   r5   __classcell__)r   s   @r   r   r      s    
 FRr   r   c           
     ^  K   dt         j                   dt         j                   dt        t         dd       d}	 t        j
                  j                  | j                  |       d {    t        j                  ddt        	       y 7 !# t        j                  ddt        	       w xY ww)
Nz
trio REPL z on zv
Use "await" directly instead of "trio.run()".
Type "help", "copyright", "credits" or "license" for more information.
ps1z>>> zimport trioignorez ^coroutine .* was never awaited$)messagecategory)r*   versionplatformgetattrr   	to_threadr#   interactwarningsfilterwarningsRuntimeWarning)consolebanners     r   run_replrL   :   s     
S[[Mcll^ 4" 3v&
'{		4 
nn%%g&6&6???7#	
 	@7#	
s.   8B--B (B
)B -B-
B B**B-c                    t        j                  t              5  dd l}d d d        dt        i}dD ]
  }| |   ||<    t        |      }t	        j                  t        |       y # 1 sw Y   FxY w)Nr   r   >   __file__r8   __spec__
__loader____package____builtins__)
contextlibsuppressImportErrorreadliner   r   r    rL   )original_localsrV   r   keyrJ   s        r   mainrY   L   so    			[	)  '-d^K 0 +3/C0 %[1GHHXw s   A$$A-)rJ   r   r6   r7   )rW   r   r6   r7   )
__future__r   r   rS   r   r*   r   rG   r2   r   r!   r   trio.lowlevel
trio._utilr   r   rL   rY    r   r   <module>r^      sS    " 
   
   #     $R/ $R $RN
$ r   