£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<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!