관리-도구
편집 파일: middleware.cpython-38.pyc
U �Mgy � @ s� d Z ddlmZ ddlmZ ddlZddlmZ ddl m Z mZmZ ddl mZ er�ddl mZ dd l mZ dd l mZ ddl mZ ddlmZ ed edef d�Ze d�ZedkZes�dd� ZnddlmZ dd� Zdd� ZdS )z1 Create spans from Django middleware invocations � )�wraps)�VERSIONN)�OP)� ContextVar�transaction_from_function�capture_internal_exceptions)� TYPE_CHECKING)�Any)�Callable)�Optional)�TypeVar)�Span�F.)�boundZ$import_string_should_wrap_middleware)� � c C s t S �N)�object)�_� r �W/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/django/middleware.py�<lambda>$ � r r )�_asgi_middleware_mixin_factoryc sD ddl m} | j� � fdd�}|| _| jj��fdd�}|| j_d S )Nr )�basec s � | �}t �d �rt|| �}|S r )�%_import_string_should_wrap_middleware�get�_wrap_middleware)�dotted_path�rv)�old_import_stringr r �sentry_patched_import_string/ s z>patch_django_middlewares.<locals>.sentry_patched_import_stringc s* t �d� z� | |�W �S t �d� X d S )NTF)r �set)�args�kwargs)�old_load_middlewarer r �sentry_patched_load_middleware<