관리-도구
편집 파일: views.cpython-37.pyc
B T a � @ s� d dl mZ d dlmZ d dlmZ er4d dlmZ yd dlm Z W n e k r\ dZ Y nX yd dlmZ W n e e fk r� dZY nX dd � Zd d� ZdS )� )�Hub)�MYPY)� _functools)�Any)�iscoroutinefunctionN)�wrap_async_viewc s@ ddl m} ddlm� | j�t���� �fdd��}|| _d S )Nr )�BaseHandler)�DjangoIntegrationc sf �| f|�|�}t j}|�� �}|d k r^|jr^td k rRtd k rRt|�rRt||�}qbt||�}n|}|S )N)r �currentZget_integrationZmiddleware_spansr r �_wrap_sync_view)�self�args�kwargs�callback�hubZintegration�sentry_wrapped_callback)r �old_make_view_atomic� �U/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/integrations/django/views.py�sentry_patched_make_view_atomic s z4patch_views.<locals>.sentry_patched_make_view_atomic)Zdjango.core.handlers.baser Zsentry_sdk.integrations.djangor Zmake_view_atomicr �wraps)r r r )r r r �patch_views s r c s t �� �� �fdd��}|S )Nc s. �j d| jjd�� � | f|�|�S Q R X d S )Nzdjango.view)�op�description)Z start_spanZresolver_matchZ view_name)Zrequestr r )r r r r r = s z0_wrap_sync_view.<locals>.sentry_wrapped_callback)r r )r r r r )r r r r ; s r )Zsentry_sdk.hubr Zsentry_sdk._typesr � sentry_sdkr �typingr Zasyncior �ImportErrorZ#sentry_sdk.integrations.django.asgir �SyntaxErrorr r r r r r �<module> s &