
    bJi,                       d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	m
Z
 d dlmZmZmZmZmZmZ ej        dk     rd dlmZ  ed	ed
e          Z ede          Z eded
e          Z ede          Z edd          Z edd          Zd"dZd#dZd Z G d  deee                   Z G d! dee         e          Z dS )$    )annotationsN)CallableSequence)partial)getmroisclass)TYPE_CHECKINGGenericTypeTypeVarcastoverload)      )r   _BaseExceptionT_coT)bound	covariantdefault_BaseExceptionT)r   _ExceptionT_co_ExceptionT_ExceptionGroupSelfExceptionGroup_BaseExceptionGroupSelfBaseExceptionGroupexcBaseExceptionparentstuple[type[BaseException]]returnboolc                R    t          | j                  d d         D ]	}||v r dS 
dS )NTF)r   	__class__)r   r   clss      `/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/exceptiongroup/_exceptions.pycheck_direct_subclassr'      sB     cm$$SbS)  '>>44  5    	condition`type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] | Callable[[_BaseExceptionT_co], bool]$Callable[[_BaseExceptionT_co], bool]c                   t          |           rJt          t          t          t                   |           t                    rt          t          | f          S t          | t                    r0t          d | D                       rt          t          |           S nt          |           rt          d|           S t          d          )N)r   c              3  ^   K   | ](}t          |          ot          |t                    V  )d S N)r   
issubclassr   ).0xs     r&   	<genexpr>z'get_condition_filter.<locals>.<genexpr>-   s7      NNqwqzz:jM::NNNNNNr(   zCallable[[BaseException], bool]z?expected a function, exception type or tuple of exception types)r   r/   r   r   r   r   r'   
isinstancetupleallcallable	TypeError)r)   s    r&   get_condition_filterr8   #   s    
 y BjT- ),,m  B ,ylCCCC	Iu	%	% BNNINNNNN 	E0)DDDD	E	)		 B5yAAA
U
V
VVr(   c                    |                      |          }| j        |_        | j        |_        | j        |_        t	          | d          rt          | j                  |_        |S )N	__notes__)derive	__cause____context____traceback__hasattrlistr:   )selfexcsegs      r&   _derive_and_copy_attributesrD   5   sY    	T		B>BL%BN)Bt[!! ,DN++Ir(   c                  L    e Zd ZdZd3 fd
Zd4dZd5dZed6d            Zed7d            Z	e
d8d            Ze
d9d            Ze
d:d            Zd;dZe
d<d!            Ze
d=d#            Ze
d>d%            Zd?d(Ze
d@d,            Ze
dAd/            ZdAd0Zd6d1Zd6d2Z xZS )Br   z/A combination of multiple unrelated exceptions.r%   type[_BaseExceptionGroupSelf]_BaseExceptionGroup__messagestr_BaseExceptionGroup__exceptionsSequence[_BaseExceptionT_co]r    r   c                   t          |t                    st          dt          |                     t          |t                    st          d          |st          d          t          |          D ]-\  }}t          |t                    st          d| d          .| t          u r t          d |D                       rt          } t          | t                    rI|D ]F}t          |t                    s/| t          u rt          d          t          d| j                  Gt                                          | ||          }t!          |          |_        |S )	Nzargument 1 must be str, not z/second argument (exceptions) must be a sequencez9second argument (exceptions) must be a non-empty sequencezItem z4 of second argument (exceptions) is not an exceptionc              3  @   K   | ]}t          |t                    V  d S r.   )r3   	Exception)r0   r   s     r&   r2   z-BaseExceptionGroup.__new__.<locals>.<genexpr>X   s,      FF#:c9--FFFFFFr(   z/Cannot nest BaseExceptions in an ExceptionGroupzCannot nest BaseExceptions in )r3   rH   r7   typer   
ValueError	enumerater   r   r5   r   r/   rM   __name__super__new__r4   _exceptions)r%   rG   rI   ir   instancer$   s         r&   rS   zBaseExceptionGroup.__new__C   s   
 )S)) 	NL4	??LLMMM,11 	OMNNN 	K    -- 	 	FAsc=11  SASSS  
 $$$FFFFFFF %$c9%% 
	# 	 	!#y11 n,,'M   (MS\MM   77??3	<@@$\22r(   argsobjectNonec                .    t          j        | ||g|R   d S r.   )r   __init__)rA   rG   rI   rW   s       r&   r[   zBaseExceptionGroup.__init__k   s'     	tYDtDDDDDDr(   notec                    t          |t                    s(t          d|dt          |          j         d          t          | d          sg | _        | j                            |           d S )NzExpected a string, got note=z (type )r:   )r3   rH   r7   rN   rQ   r?   r:   append)rA   r\   s     r&   add_notezBaseExceptionGroup.add_notes   s|    $$$ 	TtTTd4jj>QTTT   t[)) 	+(*DNd#####r(   c                    | j         d         S )Nr   )rW   rA   s    r&   messagezBaseExceptionGroup.message~   s    y|r(   Gtuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]c                *    t          | j                  S r.   )r4   rT   rb   s    r&   
exceptionszBaseExceptionGroup.exceptions   s     T%&&&r(   _BaseExceptionGroup__condition1type[_ExceptionT] | tuple[type[_ExceptionT], ...]"ExceptionGroup[_ExceptionT] | Nonec                    d S r.    rA   rg   s     r&   subgroupzBaseExceptionGroup.subgroup   s	     .1Sr(   9type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...]*BaseExceptionGroup[_BaseExceptionT] | Nonec                    d S r.   rk   rl   s     r&   rm   zBaseExceptionGroup.subgroup   s	     69Sr(   >Callable[[_BaseExceptionT_co | _BaseExceptionGroupSelf], bool]-BaseExceptionGroup[_BaseExceptionT_co] | Nonec                    d S r.   rk   rl   s     r&   rm   zBaseExceptionGroup.subgroup   s	     9<r(   ztype[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...] | Callable[[_BaseExceptionT_co | _BaseExceptionGroupSelf], bool]c                `   t          |          }d} ||           r| S g }| j        D ]m}t          |t                    r3|                    |          }||                    |           ||urd}J ||          r|                    |           kd}n|s| S |rt          | |          }|S d S )NFT)r8   rf   r3   r   rm   r_   rD   )rA   rg   r)   modifiedrf   r   rm   groups           r&   rm   zBaseExceptionGroup.subgroup   s     )55	9T?? 	K*,
? 	  	 C#122 
 <<44'%%h///3&&#H3  !!#&&&& 	K 	/jAAEL4r(   Xtuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]c                    d S r.   rk   rl   s     r&   splitzBaseExceptionGroup.split   	     sr(   `tuple[BaseExceptionGroup[_BaseExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]c                    d S r.   rk   rl   s     r&   rz   zBaseExceptionGroup.split   r{   r(   ctuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]c                    d S r.   rk   rl   s     r&   rz   zBaseExceptionGroup.split   s	     sr(   r*   !  tuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None] | tuple[BaseExceptionGroup[_BaseExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None] | tuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]c                   t          |          } ||           r| d fS g }g }| j        D ]}t          |t                    rG|                    |          \  }}||                    |           ||                    |           ^ ||          r|                    |           |                    |           d }|rt          | |          }d }	|rt          | |          }	||	fS r.   )r8   rf   r3   r   rz   r_   rD   )
rA   rg   r)   matching_exceptionsnonmatching_exceptionsr   matchingnonmatchingmatching_groupnonmatching_groups
             r&   rz   zBaseExceptionGroup.split   s4   & )55	9T?? 	:3568? 	3 	3C#122 
3(+		)(<(<%+''..x888**11+>>>3 3#**3////&--c22229= 	T8?RSSN<@! 	 ;,! ! 000r(   _BaseExceptionGroup__excsSequence[_ExceptionT]ExceptionGroup[_ExceptionT]c                    d S r.   rk   rA   r   s     r&   r;   zBaseExceptionGroup.derive  s    TWTWr(   Sequence[_BaseExceptionT]#BaseExceptionGroup[_BaseExceptionT]c                    d S r.   rk   r   s     r&   r;   zBaseExceptionGroup.derive  s	     /2cr(   c                ,    t          | j        |          S r.   )r   rc   r   s     r&   r;   zBaseExceptionGroup.derive  s     "$,777r(   c                ~    t          | j                  dk    rdnd}| j         dt          | j                   d| dS )N    sz (z sub-exceptionr^   )lenrT   rc   )rA   suffixs     r&   __str__zBaseExceptionGroup.__str__  sL    4+,,11s,PP#d&6"7"7PPvPPPPr(   c                X    | j         j         d| j        d         d| j        d         dS )N(r   z, r   r^   )r$   rQ   rW   rb   s    r&   __repr__zBaseExceptionGroup.__repr__  s2    .)OODIaLOOdilOOOOr(   )r%   rF   rG   rH   rI   rJ   r    r   )rG   rH   rI   rJ   rW   rX   r    rY   )r\   rH   r    rY   )r    rH   )r    rd   )rg   rh   r    ri   )rg   rn   r    ro   )rg   rq   r    rr   )rg   rt   r    ro   )rg   rh   r    rx   )rg   rn   r    r|   )rg   rq   r    r~   )rg   r*   r    r   )r   r   r    r   )r   r   r    r   )rQ   
__module____qualname____doc__rS   r[   r`   propertyrc   rf   r   rm   rz   r;   r   r   __classcell__r$   s   @r&   r   r   @   s       99& & & & & &PE E E E	$ 	$ 	$ 	$    X ' ' ' X'
 1 1 1 X1 9 9 9 X9 < < < X<
   B    X    X    X01 01 01 01d WWW XW2 2 2 X28 8 8 8
Q Q Q QP P P P P P P Pr(   c                       e Zd Zd fd	ZerLedd            Zedd            Zedd            Zd fdZed d            Z	ed!d            Z	d" fdZ	 xZ
S  xZ
S )#r   r%   type[_ExceptionGroupSelf]_ExceptionGroup__messagerH   _ExceptionGroup__exceptionsSequence[_ExceptionT_co]r    r   c                J    t                                          | ||          S r.   )rR   rS   )r%   r   r   r$   s      r&   rS   zExceptionGroup.__new__  s    
 wwsI|<<<r(   ;tuple[_ExceptionT_co | ExceptionGroup[_ExceptionT_co], ...]c                    d S r.   rk   rb   s    r&   rf   zExceptionGroup.exceptions#  s     KN#r(   _ExceptionGroup__conditionrh   ri   c                    d S r.   rk   rA   r   s     r&   rm   zExceptionGroup.subgroup(  s	     25r(   6Callable[[_ExceptionT_co | _ExceptionGroupSelf], bool]%ExceptionGroup[_ExceptionT_co] | Nonec                    d S r.   rk   r   s     r&   rm   zExceptionGroup.subgroup-  s	     58Cr(   Ttype[_ExceptionT] | tuple[type[_ExceptionT], ...] | Callable[[_ExceptionT_co], bool]c                F    t                                          |          S r.   )rR   rm   rA   r   r$   s     r&   rm   zExceptionGroup.subgroup2  s     77##K000r(   Ptuple[ExceptionGroup[_ExceptionT] | None, ExceptionGroup[_ExceptionT_co] | None]c                    d S r.   rk   r   s     r&   rz   zExceptionGroup.split:  	    
 3r(   Stuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]c                    d S r.   rk   r   s     r&   rz   zExceptionGroup.splitA  r   r(   rA   c                F    t                                          |          S r.   )rR   rz   r   s     r&   rz   zExceptionGroup.splitH  s     77==---r(   )r%   r   r   rH   r   r   r    r   )r    r   )r   rh   r    ri   )r   r   r    r   )r   r   r    ri   )r   rh   r    r   )r   r   r    r   )rA   r   r   r   r    r   )rQ   r   r   rS   r	   r   rf   r   rm   rz   r   r   s   @r&   r   r     s:       = = = = = =  /.		N 	N 	N 
	N 
	5 	5 	5 
	5 
	8 	8 	8 
	8	1 	1 	1 	1 	1 	1 
	 	 	 
	 
	 	 	 
		. 	. 	. 	. 	. 	. 	. 	. 	. 	.O/. /. /. /.r(   )r   r   r   r   r    r!   )r)   r*   r    r+   )!
__future__r   syscollections.abcr   r   	functoolsr   inspectr   r   typingr	   r
   r   r   r   r   version_infotyping_extensionsr   r   r   rM   r   r   r   r   r'   r8   rD   r   r   rk   r(   r&   <module>r      s   " " " " " " 



 . . . . . . . .       # # # # # # # # H H H H H H H H H H H H H H H Hg))))))W}    '+=AAAIy   gm9555g3;KLLL !'";CWXXX    W W W W$  VP VP VP VP VP0B(C VP VP VPr7. 7. 7. 7. 7.'7 7. 7. 7. 7. 7.r(   