o
    hh	                     @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ erId dlm	Z	 d dlm
Z
 d dlmZ d dlmZ d d	lmZ e	ee eee ge
f ZG d
d deZdd ZdddZdS )    N)capture_internal_exceptionsevent_from_exception)Integration)TYPE_CHECKING)Callable)Any)Type)Optional)TracebackTypec                   @   s*   e Zd ZdZdZdddZedd ZdS )	ExcepthookIntegration
excepthookFc                 C   s"   t |tstd|f || _d S )Nz7Invalid value for always_run: %s (must be type boolean))
isinstancebool
ValueError
always_run)selfr    r   d/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/sentry_sdk/integrations/excepthook.py__init__   s   

zExcepthookIntegration.__init__c                   C   s   t tjt_d S )N)_make_excepthooksysr   r   r   r   r   
setup_once)   s   z ExcepthookIntegration.setup_onceNF)__name__
__module____qualname__
identifierr   r   staticmethodr   r   r   r   r   r      s    

r   c                    s    fdd}|S )Nc                    s   t  t}|d u r | ||S t|jrBt ! t| ||ft  jdddd\}}t j	||d W d    n1 s=w   Y   | ||S )Nr   F)typehandled)client_options	mechanism)hint)

sentry_sdk
get_clientget_integrationr   _should_sendr   r   r   optionscapture_event)type_value	tracebackintegrationeventr"   old_excepthookr   r   sentry_sdk_excepthook1   s   

z/_make_excepthook.<locals>.sentry_sdk_excepthookr   )r/   r0   r   r.   r   r   /   s   r   Fc                 C   s   | rdS t tdrdS dS )NTps1F)hasattrr   )r   r   r   r   r&   I   s
   
r&   r   )r   r#   sentry_sdk.utilsr   r   sentry_sdk.integrationsr   typingr   r   r   r   r	   typesr
   BaseException
Excepthookr   r   r&   r   r   r   r   <module>   s&    