
    tniC	                         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r7d 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e          ZddZddedefdZdS )    N)capture_internal_exceptionsevent_from_exception)Integration)TYPE_CHECKING)Callable)Any)Type)Optional)TracebackTypec                   @    e Zd ZdZdZddeddfdZed	d            ZdS )
ExcepthookIntegration
excepthookF
always_runreturnNc                 d    t          |t                    st          d|d          || _        d S )NzInvalid value for always_run: z (must be type boolean))
isinstancebool
ValueErrorr   )selfr   s     _/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/sentry_sdk/integrations/excepthook.py__init__zExcepthookIntegration.__init__   sA    *d++ 	*::    %    c                  L    t          t          j                  t          _        d S )N)_make_excepthooksysr    r   r   
setup_oncez ExcepthookIntegration.setup_once'   s    )#.99r   F)r   N)	__name__
__module____qualname__
identifierr   r   r   staticmethodr   r   r   r   r   r      se        JJ% %4 %D % % % % : : : \: : :r   r   old_excepthook
Excepthookr   c                 .     dddt           dddd f fd}|S )Ntype_zType[BaseException]value	tracebackzOptional[TracebackType]r   c                    t          j                                        t                    }| | ||          S t	          |j                  rmt                      5  t          | ||ft          j                    j        ddd          \  }}t          j	        ||           d d d            n# 1 swxY w Y    | ||          S )Nr   F)typehandled)client_options	mechanism)hint)

sentry_sdk
get_clientget_integrationr   _should_sendr   r   r   optionscapture_event)r'   r(   r)   integrationeventr/   r$   s         r   sentry_sdk_excepthookz/_make_excepthook.<locals>.sentry_sdk_excepthook-   s   
 !+--==>STT
 !>%	:::.// 	;,.. ; ;2E9-#-#8#:#:#B'3FF  t
 (T::::; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ~eUI666s   AB22B69B6)BaseException)r$   r8   s   ` r   r   r   ,   sM    7$77 -7 
	7 7 7 7 7 70 ! r   Fr   c                 <    | rdS t          t          d          rdS dS )NTps1F)hasattrr   )r   s    r   r3   r3   H   s-     tsE  u4r   )r$   r%   r   r%   r   )r   r0   sentry_sdk.utilsr   r   sentry_sdk.integrationsr   typingr   r   r   r	   r
   typesr   r9   r%   r   r   r   r3   r   r   r   <module>rA      s_   



            0 / / / / /             ######	m	mXm-DE	J: : : : :K : : :$! ! ! !8	 	T 	d 	 	 	 	 	 	r   