
    tni	                         d dl Z d dlmZ d dlZerd dlmZmZmZ d dlZ G d d          ZddZ	ddZ
er G d dej        j        e          ZdS  d             ZdS )    N)TYPE_CHECKING)AnyContextManagerOptionalc                   *    e Zd ZdZddZddZddZdS )
_InitGuardzUsing the return value of sentry_sdk.init as a context manager and manually calling the __enter__ and __exit__ methods on the return value are deprecated. We are no longer maintaining this functionality, and we will remove it in the next major release.clientsentry_sdk.ClientreturnNc                     || _         d S N)_client)selfr	   s     \/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/sentry_sdk/_init_implementation.py__init__z_InitGuard.__init__   s        c                 H    t          j        | j        dt                     | S N   )
stacklevelcategory)warningswarn,_CONTEXT_MANAGER_DEPRECATION_WARNING_MESSAGEDeprecationWarning)r   s    r   	__enter__z_InitGuard.__enter__   s.    ='	
 	
 	
 	
 r   exc_typer   	exc_valuetbc                     t          j        | j        dt                     | j        }||                                 d S d S r   )r   r   r   r   r   close)r   r   r   r   cs        r   __exit__z_InitGuard.__exit__!   sM    ='	
 	
 	
 	
 L=GGIIIII =r   )r	   r
   r   N)r   r   )r   r   r   r   r   r   r   N)__name__
__module____qualname__r   r   r   r#    r   r   r   r      s[        	J 1      	 	 	 	 	 	r   r   r   c                      d S r   r'   r'   r   r   _check_python_deprecationsr)   -   s	     	Dr   argsOptional[str]kwargsr   ContextManager[Any]c                      t          j        | i |}t          j                                        |           t	                       t          |          }|S )zsInitializes the SDK and optionally integrations.

    This takes the same arguments as the client constructor.
    )
sentry_sdkClientget_global_scope
set_clientr)   r   )r*   r,   r	   rvs       r   _initr4   4   sT    
 ///F!!,,V444   	F		BIr   c                       e Zd ZdS )initN)r$   r%   r&   r'   r   r   r6   r6   G   s        r   r6   c                      t           S r   )r4   r'   r   r   <lambda>r8   O   s    E r   )r   N)r*   r+   r,   r   r   r-   )r   typingr   r/   r   r   r   sentry_sdk.constsr   r)   r4   constsClientConstructorr6   r'   r   r   <module>r=      s
                    4444444444       @	 	 	 		 	 	 	      z 2J      MMDDDr   