관리-도구
편집 파일: asyncio.cpython-38.pyc
U �Mg � @ s� d dl Z d dlZd dlmZ d dlmZmZ d dlmZm Z zd dl Z d dlmZ W n e k rp ed��Y nX d dlmZ er�d dlmZ d d lmZ d d lmZ dd� Zd d� Zdd� ZG dd� de�ZdS )� N)�OP)�Integration�DidNotEnable)�event_from_exception�reraise)�Taskzasyncio not available)� TYPE_CHECKING)�Any)� Coroutine)�ExcInfoc C s t | dd �pt | dd �pdS )N�__qualname__�__name__zcoroutine without __name__)�getattr��coro� r �M/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/asyncio.py�get_name s ��r c sH d � z*t �� } | �� � � fdd�}| �|� W n tk rB Y nX d S )Nc sH � fdd�}�r �| |� f|�S t |� fd| i|��}|jrD|jd= |S )Nc � sn d } t �� �X t jtjt� �tjd��4 z� I d H } W n tk rT t t � � Y nX W 5 Q R X W 5 Q R X | S )N)�op�name�origin)� sentry_sdkZisolation_scopeZ start_spanr ZFUNCTIONr �AsyncioIntegrationr � Exceptionr �_capture_exception)�resultr r r �_coro_creating_hub_and_span* s �$zPpatch_asyncio.<locals>._sentry_task_factory.<locals>._coro_creating_hub_and_span�loop���)r Z_source_traceback)r r �kwargsr �task�Zorig_task_factoryr r �_sentry_task_factory'