관리-도구
편집 파일: hub.cpython-37.opt-1.pyc
B T a|V � @ s d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dl m Z d dlmZm Z d dlmZ d d lmZmZmZmZ d d lmZ e�r`d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm Z d dlm!Z! d dlm"Z" d dlm#Z# d dl$m%Z% d dlm&Z&m'Z'm(Z(m)Z)m*Z* d dl+m,Z, e!d�Z-ndd� Z"ed�Z.dd� Z/d d!� Z0G d"d#� d#e1�Z2d$d%� Z3d d lmZ e�r�G d&d'� d'e,e#e �Z4n d(d)� � Z4G d*d+� d+e5�Z6G d,d-� d-e1�Z7G d.d/� d/ee6��Z8e8� Z9e.�:e9� dS )0� N)�datetime)�contextmanager)�with_metaclass)�Scope)�Client)�Span�Transaction)�Session)�exc_info_from_error�event_from_exception�logger� ContextVar)�MYPY)�Union)�Any)�Optional)�Tuple)�Dict)�List)�Callable)� Generator)�Type)�TypeVar)�overload)�ContextManager)�Integration)�Event�Hint� Breadcrumb�BreadcrumbHint�ExcInfo)�ClientConstructor�Tc C s | S )N� )�xr# r# �?/opt/alt/python37/lib/python3.7/site-packages/sentry_sdk/hub.pyr 1 s r Zsentry_current_hubc C sd |r|rt d��|d k r@t�| �}t|�r4||� q`|�|� n |r\t�| �}|jf |� n| }|S )Nzcannot provide scope and kwargs)� TypeError�copy�callableZupdate_from_scopeZupdate_from_kwargs)�baseZscope_changeZscope_kwargsZfinal_scoper# r# r% � _update_scope9 s r* c C s t jj} | sdS | jd S )NFZsend_default_pii)�Hub�current�client�options)r- r# r# r% �_should_send_default_piiK s r/ c @ s$ e Zd Zdd� Zdd� Zdd� ZdS )� _InitGuardc C s || _ d S )N)�_client)�selfr- r# r# r% �__init__T s z_InitGuard.__init__c C s | S )Nr# )r2 r# r# r% � __enter__X s z_InitGuard.__enter__c C s | j }|d k r|�� d S )N)r1 �close)r2 �exc_type� exc_value�tb�cr# r# r% �__exit__\ s z_InitGuard.__exit__N)�__name__� __module__�__qualname__r3 r4 r: r# r# r# r% r0 S s r0 c O s"