
    fi(                         d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	m
Z
 	 d dlZd dlmZ n# e$ r  ed          w xY wd dlmZmZ erd dlmZ d d	lmZ d d
lmZ d Zd Zd Z G d de          ZdS )    N)OP)IntegrationDidNotEnable)event_from_exceptionloggerreraise)Taskzasyncio not available)castTYPE_CHECKING)Any)	Coroutine)ExcInfoc                 J    t          | dd           pt          | dd           pdS )N__qualname____name__zcoroutine without __name__)getattr)coros    o/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/sentry_sdk/integrations/asyncio.pyget_namer      s4     	nd++ 	(4T**	('    c                      d 	 t          j                    } |                                 fd}|                     |           d S # t          $ r t          j        d           Y d S w xY w)Nc                    fd}d }r |  |            fi |}|&t           |            fd| i|}|j        r|j        d= 	 t          d|                              t	                     d           n# t
          $ r Y nw xY w|S )Nc                    K   d } t          j                    5  t          j        t          j        t                    t          j                  5  	  d {V } n5# t          $ r}|d d }~wt          $ r t          t                        Y nw xY wd d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   | S )N)opnameorigin)
sentry_sdkisolation_scope
start_spanr   FUNCTIONr   AsyncioIntegrationr   StopAsyncIteration	Exceptionr   _capture_exception)resulter   s     r   _task_with_sentry_span_creationzTpatch_asyncio.<locals>._sentry_task_factory.<locals>._task_with_sentry_span_creation*   sa     /11 ; ;#.;%d^^18   
; 
;
;+/ZZZZZZFF1 . . ."#-( ; ; ;#%7%9%9::::;
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
; 
;; ; ; ; ; ; ; ; ; ; ; ; ; ; ; se   9B5BAB
B'A**"BBBBB5B"	"B5%B"	&B55B9<B9loopzasyncio.Task[Any]z (Sentry-wrapped))r	   _source_tracebackr
   set_namer   AttributeError)r(   r   kwargsr'   taskorig_task_factorys    `   r   _sentry_task_factoryz+patch_asyncio.<locals>._sentry_task_factory'   s       & D ! ((99;; ?E  | ;;==SSDSFSS) 3.r2($//88~~888    "    Ks   3A; ;
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(   r0   r/   s     @r   patch_asyncior7       s    B
')) 11333	 3	 3	 3	 3	j 	233333 
 
 
P	
 	
 	
 	
 	
 	

s   AA A*)A*c                      t          j                    } t          j                    }|                    t
                    }|3t          | |j        ddd          \  }}t          j        ||           | S )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$   h   s}    |~~H"$$F(();<<K*!>(U;;
 
 
t
 	 T2222Or   c                   2    e Zd ZdZde Zed             ZdS )r!   r1   zauto.function.c                  "    t                       d S )N)r7    r   r   
setup_oncezAsyncioIntegration.setup_once~   s     	r   N)r   
__module__r   
identifierr   staticmethodrJ   rI   r   r   r!   r!   z   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!   rI   r   r   <module>rV      sn   



                 = = = = = = = = B B B B B B B B B B0NNN""""""" 0 0 0
,.
/
//0 ' & & & & & & & *))))))))))))  E
 E
 E
P  $         s   
- >