
    bJiH                        d dl mZ d dlZd dlZd dlmZmZmZ d dlm	Z	 d dl
mZ d dlmZmZ ej        dk     rdd	lmZ ereee         gef         Z G d
 d          ZddZdS )    )annotationsN)CallableIterableMapping)AbstractContextManager)TracebackType)TYPE_CHECKINGAny)         )BaseExceptionGroupc                  .    e Zd ZddZddZddZddZdS )_Catcherhandler_map2Mapping[tuple[type[BaseException], ...], _Handler]c                    || _         d S N)_handler_map)selfr   s     [/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/exceptiongroup/_catch.py__init__z_Catcher.__init__   s    '    returnNonec                    d S r    )r   s    r   	__enter__z_Catcher.__enter__   s    r   etypetype[BaseException] | NoneexcBaseException | NonetbTracebackType | Noneboolc                    |[|                      |          }||u rdS |dS t          |t                    r$	 ||j        # t          $ r |j        |_         w xY w||dS )NFT)handle_exception
isinstancer   	__cause____context__)r   r   r!   r#   	unhandleds        r   __exit__z_Catcher.__exit__   s     ?--c22ICu"tc#566 'S]:-    14	-	  S(us   A   ABaseExceptionc                   t          |t                    r|}nt          d|g          }g }| j                                        D ]\  }}|                    |          \  }}|r	 	 |# t          $ r  ||          }Y nw xY w	 t          j        |          rt          d|d|d          |nr# t          $ r>}||u r|                    |           n|	                    |j
                   Y d }~n/d }~wt          $ r}|                    |           Y d }~nd }~ww xY w|s n|r+t          |          dk    r|d         S t          d|          S |r)t          |j
                  dk    r|j
        d         |u r|S |S )N zError trying to handle z with z,. Exception handler must be a sync function.r   r   )r(   r   r   itemssplitinspectiscoroutine	TypeErrorappendextend
exceptionsr-   len)	r   r!   excgroupnew_exceptions	exc_typeshandlermatchedresultnew_excs	            r   r'   z_Catcher.handle_exception2   s.   c-.. 	5HH)"se44H.0"&"3"9"9";"; 	 	Iw (y 9 9GX ##2%- 2 2 2!(!1!12 *622 #'Ig I Iw I I I   ### * B B B'))&--g6666&--g.@AAA$ 3 3 3"))'222222223    
	>""a''%a((%b.999	X011Q668;Nq;QUX;X;XJOs<   &A((B =B0?B  B00
D:4C33D DDN)r   r   )r   r   )r   r    r!   r"   r#   r$   r   r%   )r!   r-   r   r"   )__name__
__module____qualname__r   r   r,   r'   r   r   r   r   r      sd        ( ( ( (      4+ + + + + +r   r   
__handlersFMapping[type[BaseException] | Iterable[type[BaseException]], _Handler]r   AbstractContextManager[None]c                n   t          | t                    st          d          i }|                                 D ]\  }}t          |t                    rt          |t                    r|f}n4t          |t                    rt          |          }nt          d          t          |          st          d          |D ]_}t          |t                    rt          |t                    st          d          t          |t                    rt          d          `|||<   t          |          S )Nzthe argument must be a mappingzCeach key must be either an exception classes or an iterable thereofzhandlers must be callablezHcatching ExceptionGroup with catch() is not allowed. Use except instead.)r(   r   r4   r0   type
issubclassr-   r   tuplecallabler   r   )rC   r   type_or_iterabler<   iterableexc_types         r   catchrN   `   s~    j'** :8999 	  &0%5%5%7%7 ( (!'&-- 		*m3
 3
 		 )*HH((33 	-..HHU      	97888  	 	Hh-- Z-6 6     
 ($677 *   !(HK   r   )rC   rD   r   rE   )
__future__r   r2   syscollections.abcr   r   r   
contextlibr   typesr   typingr	   r
   version_info_exceptionsr   _Handlerr   rN   r   r   r   <module>rX      s   " " " " " "  



 7 7 7 7 7 7 7 7 7 7 - - - - - -       % % % % % % % %g////// 8+C01367HL L L L L L L L^*! *! *! *! *! *!r   