
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    „á§\1  ã                   @   sœ   d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZmZmZ d dlZd dlmZmZ G d	d
„ d
eƒZdd„ Zdd„ ZdS )é    N)Úreraise)ÚHub)ÚIntegration)Úignore_logger)Ú_filter_headers)Úcapture_internal_exceptionsÚevent_from_exceptionÚHAS_REAL_CONTEXTVARS)ÚApplicationÚHTTPExceptionc                   @   s   e Zd ZdZedd„ ƒZdS )ÚAioHttpIntegrationÚaiohttpc                     s0   t stdƒ‚tdƒ tj‰ ‡ fdd„} | t_d S )NzRThe aiohttp integration for Sentry requires Python 3.7+  or aiocontextvars packagezaiohttp.serverc                 Ÿ   s*   ‡ ‡‡‡‡fdd„}t  ¡  |ƒ ¡I d H S )Nc               
   “   sÐ   t j} |  t¡d kr,ˆˆˆfˆ žˆŽI d H S t ˆ¡}t t jƒ�†} |  ¡ �}| ¡  | t	|ƒ¡ W 5 Q R X zˆˆˆƒI d H }W n4 t
k
r–   ‚ Y n  tk
r´   tt| ƒŽ  Y nX |W  5 Q R £ S Q R X d S )N)r   ÚcurrentZget_integrationr   ÚweakrefÚrefZconfigure_scopeZclear_breadcrumbsZadd_event_processorÚ_make_request_processorr   Ú	Exceptionr   Ú_capture_exception)ÚhubÚweak_requestZscopeÚresponse)ÚargsÚkwargsÚ
old_handleÚrequestÚself© úP/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/aiohttp.pyÚinner0   s    

zGAioHttpIntegration.setup_once.<locals>.sentry_app_handle.<locals>.inner)ÚasyncioZget_event_loopZcreate_task)r   r   r   r   r   ©r   )r   r   r   r   r   Úsentry_app_handle.   s    z8AioHttpIntegration.setup_once.<locals>.sentry_app_handle)r	   ÚRuntimeErrorr   r
   Ú_handle)r!   r   r    r   Ú
setup_once   s    ÿzAioHttpIntegration.setup_onceN)Ú__name__Ú
__module__Ú__qualname__Ú
identifierÚstaticmethodr$   r   r   r   r   r      s   r   c                    s   ‡ fdd„}|S )Nc              	      s€   ˆ ƒ }|d kr| S t ƒ �^ |  di ¡}d|j|j|jf |d< |j|d< |j|d< d|ji|d< tt	|j
ƒƒ|d< W 5 Q R X | S )	Nr   z	%s://%s%sÚurlÚquery_stringÚmethodZREMOTE_ADDRÚenvÚheaders)r   Ú
setdefaultÚschemeÚhostÚpathr+   r,   Zremoter   Údictr.   )ÚeventÚhintr   Zrequest_info©r   r   r   Úaiohttp_processorP   s    ý


z2_make_request_processor.<locals>.aiohttp_processorr   )r   r7   r   r6   r   r   N   s    r   c                 C   s6   t  ¡ }t|| jjdddœd�\}}| j||d� |S )Nr   F)ÚtypeZhandled)Zclient_optionsZ	mechanism)r5   )ÚsysÚexc_infor   ZclientÚoptionsZcapture_event)r   r:   r4   r5   r   r   r   r   o   s    ý
r   )r9   r   Zsentry_sdk._compatr   Zsentry_sdk.hubr   Zsentry_sdk.integrationsr   Zsentry_sdk.integrations.loggingr   Z$sentry_sdk.integrations._wsgi_commonr   Zsentry_sdk.utilsr   r   r	   r   Zaiohttp.webr
   r   ÚRequestZAnyÚDictZTupleÚCallableZExcInfor   r   r   r   r   r   r   Ú<module>   s   2!