
    gh                         S SK r S SKrS SKJr  S SKJrJr  S SKJrJ	r	J
r
   S SKrS SKJr  S SKJrJr  \(       a  S SKJr  S S	KJr  S S
KJr  S rS rS r " S S\5      rg! \ a	    \" S5      ef = f)    N)OP)IntegrationDidNotEnable)event_from_exceptionloggerreraise)Taskzasyncio not available)castTYPE_CHECKING)Any)	Coroutine)ExcInfoc                 V    [        U SS 5      =(       d    [        U SS 5      =(       d    S$ )N__qualname____name__zcoroutine without __name__)getattr)coros    b/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/sentry_sdk/integrations/asyncio.pyget_namer      s.     	nd+ 	(4T*	('    c                     ^ S m [         R                  " 5       n U R                  5       mU4S jnU R                  U5        g ! [         a    [
        R                  " S5         g f = f)Nc                   >^ U4S jnS nT(       a  T" X" 5       40 UD6nUc1  [        U" 5       4SU 0UD6nUR                  (       a  UR                  S	  [        SU5      R                  [	        T5       S35        U$ ! [
         a     U$ f = f)Nc                  x  >#    S n [         R                  " 5          [         R                  " [        R                  [        T5      [        R                  S9    TI S h  vN n S S S 5        S S S 5        U $  N! [         a    [        [        5       6    N0f = f! , (       d  f       N:= f! , (       d  f       U $ = f7f)N)opnameorigin)
sentry_sdkisolation_scope
start_spanr   FUNCTIONr   AsyncioIntegrationr   	Exceptionr   _capture_exception)resultr   s    r   _task_with_sentry_span_creationTpatch_asyncio.<locals>._sentry_task_factory.<locals>._task_with_sentry_span_creation*   s     //1#..;;%d^188
;+/ZF 2 	 &0( ;#%7%9:;  21 sd   B:<B(BA7A5A7#B(+
B:5A77BBBB
B%	!B((
B72B:loopzasyncio.Task[Any]z (Sentry-wrapped))r	   _source_tracebackr
   set_namer   AttributeError)r'   r   kwargsr%   taskorig_task_factorys    `   r   _sentry_task_factory+patch_asyncio.<locals>._sentry_task_factory'   s    " D !(9;?E | ;=SDSFS))..r2($/88~&&78 K	 " K	s   'A> >
BBzThere is no running asyncio loop so there is nothing Sentry can patch. Please make sure you call sentry_sdk.init() within a running asyncio loop for the AsyncioIntegration to work. See https://docs.sentry.io/platforms/python/integrations/asyncio/)asyncioget_running_loopget_task_factoryset_task_factoryRuntimeErrorr   warning)r'   r/   r.   s     @r   patch_asyncior7       sd    @
'') 1131	f 	23 
P	

s   <A  A%$A%c                      [         R                  " 5       n [        R                  " 5       nUR	                  [
        5      nUb.  [        U UR                  SSS.S9u  p4[        R                  " X4S9  U $ )Nr1   F)typehandled)client_options	mechanism)hint)	sysexc_infor   
get_clientget_integrationr!   r   optionscapture_event)r?   clientintegrationeventr=   s        r   r#   r#   f   se    ||~H""$F(();<K*!>>(U;

 	  2Or   c                   2    \ rS rSrSrS\ 3r\S 5       rSrg)r!   x   r1   zauto.function.c                      [        5         g )N)r7    r   r   
setup_onceAsyncioIntegration.setup_once|   s	     	r   rJ   N)	r   
__module__r   __firstlineno__
identifierr   staticmethodrK   __static_attributes__rJ   r   r   r!   r!   x   s%    Jj\*F r   r!   )r>   r   sentry_sdk.constsr   sentry_sdk.integrationsr   r   sentry_sdk.utilsr   r   r   r1   asyncio.tasksr	   ImportErrortypingr
   r   r   collections.abcr   sentry_sdk._typesr   r   r7   r#   r!   rJ   r   r   <module>rZ      sn    
    = B B0" '))C
L$ [  0
.
//0s   
A" "A1