
    \j	                         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y d
        Zy)    N)TYPE_CHECKING)AnyContextManagerOptionalc                   (    e Zd ZdZddZddZddZy)	
_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.Nc                     || _         y N)_client)selfclients     I/root/env/lib/python3.12/site-packages/sentry_sdk/_init_implementation.py__init__z_InitGuard.__init__   s	        c                 R    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   c                     t        j                  | j                  dt               | j                  }||j                          y y r   )r   r   r   r   r   close)r   exc_type	exc_valuetbcs        r   __exit__z_InitGuard.__exit__!   s;    =='	
 LL=GGI r   )r   zsentry_sdk.ClientreturnN)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   c                       y r
   r&   r&   r   r   _check_python_deprecationsr(   -   s     	r   c                      t        j                  | i |}t        j                         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   )argskwargsr   rvs       r   _initr1   4   sE    
 //F!,,V4 	F	BIr   c                       e Zd Zy)initN)r#   r$   r%   r&   r   r   r3   r3   G   s    r   r3   c                      t         S r
   )r1   r&   r   r   <lambda>r5   O   s    E r   )r"   N)r.   zOptional[str]r/   r   r"   zContextManager[Any])r   typingr   r*   r   r   r   sentry_sdk.constsr   r(   r1   constsClientConstructorr3   r&   r   r   <module>r:      sX       44 @		 z  22J  Dr   