관리-도구
편집 파일: aiohttp.cpython-38.opt-1.pyc
U ��\1 � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z d dl mZ d dlm Z mZmZ d dlZd dlmZmZ G d d � d e�Zdd� Zd d� ZdS )� N)�reraise)�Hub)�Integration)� ignore_logger)�_filter_headers)�capture_internal_exceptions�event_from_exception�HAS_REAL_CONTEXTVARS)�Application� HTTPExceptionc @ s e Zd ZdZedd� �ZdS )�AioHttpIntegration�aiohttpc s0 t std��td� tj� � fdd�} | t_d S )NzRThe aiohttp integration for Sentry requires Python 3.7+ or aiocontextvars packagezaiohttp.serverc � s* � ����fdd�}t �� �|� �I d H S )Nc � s� t j} | �t�d kr,���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 tk r� tt | �� Y nX |W 5 Q R � S Q R X d S )N)r �currentZget_integrationr �weakref�refZconfigure_scopeZclear_breadcrumbsZadd_event_processor�_make_request_processorr � Exceptionr �_capture_exception)�hub�weak_requestZscopeZresponse)�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)�asyncioZget_event_loopZcreate_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 Z_handle)r r r r � setup_once s �zAioHttpIntegration.setup_onceN)�__name__� __module__�__qualname__Z identifier�staticmethodr"