관리-도구
편집 파일: asgi.cpython-38.pyc
U �Mg� � @ s* d Z ddlZddlZddlZddlmZ ddlZddlmZ ddl m Z ddlmZ ddl mZmZ ddlmZ er�dd lmZmZmZmZ dd lmZ ddlmZ ddlmZmZ ed edef d�Zeed�r�ejZej Z nejZd d d�dd�Z dd� Z!dd� Z"dd� Z#dd� Z$dd� Z%dd� Z&dS )z� Instrumentation for Django 3.0 Since this file contains `async def` it is conditionally imported in `sentry_sdk.integrations.django` (depending on the existence of `django.core.handlers.asgi`. � N)�WSGIRequest)�OP)�SentryAsgiMiddleware)�should_send_default_pii)�capture_internal_exceptions�ensure_integration_enabled)� TYPE_CHECKING)�Any�Callable�Union�TypeVar)�ASGIRequest)�HttpResponse)�Event�EventProcessor�_F.)�bound�markcoroutinefunction)�func�returnc C s t jj| _| S �N)�asyncioZ coroutinesZ _is_coroutine)r � r �Q/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/django/asgi.pyr 1 s c s � fdd�}|S )Nc sr ddl m}m} � d kr| S t� �tkr,| S t� � |� ��| � W 5 Q R X t� rnt� � |� | � W 5 Q R X | S )Nr )�DjangoRequestExtractor�_set_user_info)�sentry_sdk.integrations.djangor r �typer r Zextract_into_eventr )�event�hintr r ��requestr r �asgi_request_event_processor8 s zH_make_asgi_request_event_processor.<locals>.asgi_request_event_processorr )r! r"