
    fH                        S SK Jr  S SKrS SKrS SKJrJrJr  S SKJ	r	  S SK
Jr  S SKJrJr  \R                  S:  a  SS	KJr  \(       a  \\\   /\4   r " S
 S5      r    SS jrg)    )annotationsN)CallableIterableMapping)AbstractContextManager)TracebackType)TYPE_CHECKINGAny)         )BaseExceptionGroupc                  L    \ rS rSrSS jrS	S jr        S
S jrSS jrSrg)_Catcher   c                    Xl         g N_handler_map)selfhandler_maps     7/usr/lib/python3/dist-packages/exceptiongroup/_catch.py__init___Catcher.__init__   s    '    c                    g r    )r   s    r   	__enter___Catcher.__enter__   s    r   c                    Ub>  U R                  U5      nXBL a  gUc  g[        U[        5      (       a   XBR                  eXBeg! [         a    UR                  Ul        e f = f)NFT)handle_exception
isinstancer   	__cause____context__)r   etypeexctb	unhandleds        r   __exit___Catcher.__exit__   su     ?--c2I"c#566']]:  ( .  14	-	s   A A c                   [        U[        5      (       a  UnO[        SU/5      n/ nU R                  R                  5        H,  u  pEUR	                  U5      u  pbU(       a    UeU(       a  M,    O   U(       a   [        U5      S:X  a  US   $ [        SU5      $ U(       a-  [        UR                  5      S:X  a  UR                  S   UL a  U$ U$ ! [         a    U" U5      n Of = f [
        R                  " U5      (       a  [        SU< SU< S35      UeN! [         a?  nXL a  UR                  U5         S nANUR                  UR                  5         S nANS nAf[         a  nUR                  U5         S nAGNS nAff = f)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
exceptionsBaseExceptionlen)	r   r&   excgroupnew_exceptions	exc_typeshandlermatchedresultnew_excs	            r   r!   _Catcher.handle_exception2   s   c-..H)"se4H.0"&"3"3"9"9";I (y 9G#2%" 8/ #<2 >"a'%a((%b.99X001Q68;N;Nq;QUX;XJO; . 2!(!12 **622'5g[wk RI I  ## 3 * B)&--g66&--g.@.@AA$ 3"))'223sB   #CC$!D#C$$D
F#E=EF*FFr   N)r   z2Mapping[tuple[type[BaseException], ...], _Handler])returnNone)r%   ztype[BaseException] | Noner&   BaseException | Noner'   zTracebackType | Noner?   bool)r&   r5   r?   rA   )	__name__
__module____qualname____firstlineno__r   r   r)   r!   __static_attributes__r   r   r   r   r      s<    () " !	
 
4+r   r   c                <   [        U [        5      (       d  [        S5      e0 nU R                  5        H  u  p#[        U[        5      (       a  [        U[        5      (       a  U4nO,[        U[        5      (       a  [        U5      nO[        S5      e[        U5      (       d  [        S5      eU HX  n[        U[        5      (       a  [        U[        5      (       d  [        S5      e[        U[        5      (       d  MO  [        S5      e   X1U'   M     [        U5      $ )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   r1   r-   type
issubclassr5   r   tuplecallabler   r   )
__handlersr   type_or_iterabler:   iterableexc_types         r   catchrQ   `   s!    j'**899 	  &0%5%5%7!&--*m3
 3
 )*H((33-.HU    788 Hh--Z-6 6   
 ($677*  ! !(H? &8B K  r   )rM   zFMapping[type[BaseException] | Iterable[type[BaseException]], _Handler]r?   zAbstractContextManager[None])
__future__r   r/   syscollections.abcr   r   r   
contextlibr   typesr   typingr	   r
   version_info_exceptionsr   _Handlerr   rQ   r   r   r   <module>r[      sk    "  
 7 7 -  %g/+C01367HL L^*!V*!!*!r   