
    Oh
                        S SK Jr  S SKrS SKrS SKJrJr  S SKJrJ	r	  \	" S5      r
\R                  S:  a  \R                  rg\R                  S:  a  SSS	.       SS
 jjrgSSS	.       SS jjrSS jrg)    )annotationsN)Callable	Coroutine)AnyTypeVar_T)      )r	      Fdebugloop_factoryc                   [         R                  " XS9 nUR                  U 5      sS S S 5        $ ! , (       d  f       g = f)Nr   )asyncioRunnerrun)mainr   r   runners       I/home/james-whalen/.local/lib/python3.13/site-packages/uvicorn/_compat.pyasyncio_runr      s+     ^^%Cv::d# DCCs   0
>c                   [         R                  " 5         [        S5      e! [         a     Of = f[         R                  " U 5      (       d  [	        SU < 35      eUc  [         R
                  " 5       nOU" 5       n Uc  [         R                  " U5        Ub  UR                  U5        UR                  U 5       [        U5        UR                  UR                  5       5        UR                  UR                  5       5        Uc  [         R                  " S 5        UR                  5         $ ! Uc  [         R                  " S 5        UR                  5         f = f!  [        U5        UR                  UR                  5       5        UR                  UR                  5       5        Uc  [         R                  " S 5        UR                  5         f ! Uc  [         R                  " S 5        UR                  5         f = f= f)Nz8asyncio.run() cannot be called from a running event loopza coroutine was expected, got )r   get_running_loopRuntimeErroriscoroutine
ValueErrornew_event_loopset_event_loop	set_debugrun_until_complete_cancel_all_tasksshutdown_asyncgensshutdown_default_executorclose)r   r   r   loops       r   r   r      s   	[$$& YZZ  		
 ""4((=dXFGG))+D>D	#&&t, u%**40!$'''(?(?(AB''(F(F(HI'**40

  '**40

!$'''(?(?(AB''(F(F(HI'**40

  '**40

s>   " 
//==E ;A	D..+EG?A	G'*G?+G<<G?c                h   [         R                  " U 5      nU(       d  g U H  nUR                  5         M     U R                  [         R                  " USS065        U HP  nUR                  5       (       a  M  UR                  5       c  M-  U R                  SUR                  5       US.5        MR     g )Nreturn_exceptionsTz1unhandled exception during asyncio.run() shutdown)message	exceptiontask)r   	all_taskscancelr   gather	cancelledr(   call_exception_handler)r$   	to_cancelr)   s      r   r    r    @   s    %%d+	DKKM  		 RT RSD~~~~+++#V%)^^%5 $	     )r   zCoroutine[Any, Any, _T]r   boolr   z.Callable[[], asyncio.AbstractEventLoop] | Nonereturnr   )r$   zasyncio.AbstractEventLoopr2   None)
__future__r   r   syscollections.abcr   r   typingr   r   r   version_infor   r   r     r0   r   <module>r:      s    "  
 / T]w++K 
 GK		$%	$ 	$ E		$
 
	$" GK	"%" " E	"
 
"Hr0   