관리-도구
편집 파일: tornado.cpython-37.pyc
B T a � @ sv d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl m Z mZmZm Z mZ d dlmZmZ d dlmZmZmZ d dlmZ d d lmZ y,d d lmZ d dlmZmZ d dl m!Z! W n e"k r� ed ��Y nX d dl#m$Z$ e$�r4d dl%m&Z& d dl%m'Z' d dl%m(Z( d dl%m)Z) d dl%m*Z* d dl#m+Z+ G dd� de�Z,ej-dd� �Z.dd� Z/dd� Z0G dd� de�Z1dS )� N)�iscoroutinefunction)�Hub�_should_send_default_pii)�Transaction)�HAS_REAL_CONTEXTVARS�CONTEXTVARS_ERROR_MESSAGE�event_from_exception�capture_internal_exceptions�transaction_from_function)�Integration�DidNotEnable)�RequestExtractor�_filter_headers�_is_json_content_type)� ignore_logger)� iteritems)�version_info)�RequestHandler� HTTPError)� coroutinezTornado not installed)�MYPY)�Any)�Optional)�Dict)�Callable)� Generator)�EventProcessorc @ s e Zd ZdZedd� �ZdS )�TornadoIntegration�tornadoc sz t dk rtd��ts tdt ��td� tj� t� �} | rH� fdd�}nt� fdd��}|t_tj ��fdd �}|t_ d S ) N)� r zTornado 5+ requiredzUThe tornado integration for Sentry requires Python 3.7+ or the aiocontextvars packageztornado.accessc � s* t | �� � | f|�|�I d H S Q R X d S )N)�_handle_request_impl)�self�args�kwargs)�old_execute� �P/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/tornado.py�sentry_execute_request_handlerD s zETornadoIntegration.setup_once.<locals>.sentry_execute_request_handlerc ? s. t | �� � | f|�|�E d H }|S Q R X d S )N)r )r! r"