관리-도구
편집 파일: tornado.cpython-38.opt-1.pyc
U ��\� � @ s� d dl Z d dlmZ d dlmZmZ d dlmZmZm Z m Z d dlmZ d dl mZmZmZ d dlmZ d dlmZmZ d d lmZ G d d� de�Zdd � Zdd� ZG dd� de�Z dS )� N)�iscoroutinefunction)�Hub�_should_send_default_pii)�HAS_REAL_CONTEXTVARS�event_from_exception�capture_internal_exceptions�transaction_from_function)�Integration)�RequestExtractor�_filter_headers�_is_json_content_type)� ignore_logger)�RequestHandler� HTTPError)� coroutinec @ s e Zd ZdZedd� �ZdS )�TornadoIntegration�tornadoc s� dd l } t| dd �}|d ks$|dk r,td��ts8td��td� td� tj� t� �}|rh� fdd �}nt� fd d ��}|t_tj ��fdd�}|t_ d S ) Nr �version_info)� r zTornado 5+ requiredzUThe tornado integration for Sentry requires Python 3.6+ or the aiocontextvars packageztornado.applicationztornado.accessc � s� t j}|�t�}|d kr.� | f|�|�I d H S t�| �}t |��N}|�� �}|�� |�t |�� W 5 Q R X � | f|�|�I d H W 5 Q R � S Q R X d S �N) r �current�get_integrationr �weakref�ref�configure_scopeZclear_breadcrumbs�add_event_processor�_make_event_processor)�self�args�kwargs�hub�integration�weak_handler�scope��old_execute� �P/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/tornado.py�sentry_execute_request_handler; s zETornadoIntegration.setup_once.<locals>.sentry_execute_request_handlerc ? s� t j}|�t�}|d kr(� | f|�|�S t�| �}t |��J}|�� �}|�t|�� W 5 Q R X � | f|�|�E d H }|W 5 Q R � S Q R X d S r ) r r r r r r r r r )r r r r r! r"