관리-도구
편집 파일: threading.cpython-311.pyc
� �܋fy � � � d dl mZ d dlZd dlmZ d dlmZmZ d dlm Z d dl mZ d dlm Z d dlmZ d d lmZmZ e r3d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ ededef �� � Z G d� de� � Zd� Zd� ZdS )� )�absolute_importN��wraps)�Thread�current_thread)�Hub)�reraise)� TYPE_CHECKING)�Integration)�event_from_exception�capture_internal_exceptions)�Any)�TypeVar)�Callable)�Optional)�ExcInfo�F.)�boundc �0 � e Zd ZdZdd�Zed� � � ZdS )�ThreadingIntegration� threadingFc � � || _ d S �N)� propagate_hub)�selfr s �X/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/threading.py�__init__zThreadingIntegration.__init__ s � �*����� c �l �� t j �t �� � �fd�� � } | t _ d S )Nc �J �� t j }|� t � � }|�o|j sd }nt |� � }t � � 5 t |t | j d| j � � � � }|| _ d d d � � n# 1 swxY w Y �| g|�R i |��S )N�__func__) r �current�get_integrationr r r � _wrap_run�getattr�run)r �a�kw�hub�integration�hub_�new_run� old_starts �r �sentry_startz5ThreadingIntegration.setup_once.<locals>.sentry_start$ s� �� � �+�C��-�-�.B�C�C�K��&�"�0� $��D�D��s�8�8�D� 1�2�2� '� '�'��g�d�h� �D�H�.U�.U�V�V�G�&�D�H�'� '� '� '� '� '� '� '� '� '� '���� '� '� '� '� �9�T�,�A�,�,�,��,�,�,s �1B�B�B)r �startr )r. r- s @r � setup_oncezThreadingIntegration.setup_once sE �� � �L� � �y� � � -� -� -� -� � � -�* $����r N)F)�__name__� __module__�__qualname__� identifierr �staticmethodr0 � r r r r sH � � � � � ��J�+� +� +� +� �$� $� �\�$� $� $r r c �@ � �� t �� � �� fd�� � }|S )Nc �� �� �pt j }|5 t � � } �|g| �R i |��cd d d � � S # t $ r t t � � � Y nw xY w d d d � � d S # 1 swxY w Y d S r )r r"