+
    &h#                     2   ^ RI t ^ RIt^ RIt^ RIHt R.t ! R R]4      tRR lt]! RR4      t	 ! R R	]	4      t
 ! R
 R4      tRR ltRR lt ! R R]]4      tR tRR ltR t]R8X  d    ]! 4        R# R#   ] d    ^ RIt]P*                  ! 4        h i ; i)    N)
namedtupleExceptionCauseMixinc                   h   a a ] tR t^.t oRtRtV 3R ltR tR tV 3R lt	R
R lt
V 3R ltR	tVtV ;t# )r   a;  
A mixin class for wrapping an exception in another exception, or
otherwise indicating an exception was caused by another exception.

This is most useful in concurrent or failure-intolerant scenarios,
where just because one operation failed, doesn't mean the remainder
should be aborted, or that it's the appropriate time to raise
exceptions.

This is still a work in progress, but an example use case at the
bottom of this module.

NOTE: when inheriting, you will probably want to put the
ExceptionCauseMixin first. Builtin exceptions are not good about
calling super()
Nc                  < R pV'       d/   \        V^ ,          \        4      '       d   V^ ,          VR,          r\        S
V `  ! V .VO5/ VB pW4n        Vf   V# \        VRR 4      pVf   W4n        MWTn        \        VRR 4      pVeG   \        V4      Vn        \        VP                  4      Vn	        \        VP                  4      Vn
        V#  \        P                  ! 4       w  rxp	Vf   Vf   V?	# W8J g   WXJ dP   \        V	4      Vn	        \        V	P                  4      Vn
        VP                  R R VP                  ,           Vn        ?	V#   ?	i ; i)N   NN
root_cause
full_trace)
isinstance	Exceptionsuper__new__causegetattrr	   listr
   _tb_stacksysexc_info_extract_from_tb_extract_from_frametb_frame)clsargskwr   retr	   r
   exc_type	exc_valueexc_tb	__class__s   &*,       0lib/python3.14/site-packages/boltons/excutils.pyr   ExceptionCauseMixin.__new__B   s/   JtAw	22q'484goc/D/B/	=JUL$7
"N'NUL$7
!!*-CN599oCGell+CJJ	*-,,.'HI$5  !Z%< +620A
!$CR377!:
 s   !E 3AE Ec                    . pV P                  4       pV'       d   VP                  RV.4       VP                  V P                  4       4       RP	                  V4      # )z
Get formatted the formatted traceback and exception
message. This function exists separately from __str__()
because __str__() is somewhat specialized for the built-in
traceback module's particular usage.
z#Traceback (most recent call last):
 )_get_trace_strextendappend_get_exc_strjoin)selfr   	trace_strs   &  r"   get_strExceptionCauseMixin.get_strf   sO     '')	JJ>	JK

4$$&'wws|    c                    \        V R . 4      pV P                  '       d
   VR,          pV'       d   V^ ,          '       d
   V^ ,          # R# )r   r   r%   )r   r   )r+   r   s   & r"   _get_message ExceptionCauseMixin._get_messaget   s9    tVR(:::8DDGG7Nr/   c                   < V P                   '       g   \        SV `	  4       # V P                  '       d0   R P	                  \
        P                  ! V P                  4      4      # R # )r%   )r   r   __repr__r
   r*   	tracebackformat_list)r+   r!   s   &r"   r&   "ExceptionCauseMixin._get_trace_str|   sD    zzz7#%%???77900ABBr/   c                   \        V P                  4      pV P                  4       p. pV'       d   V P                  P                  R .pV'       d   VP                  VRVR.4       MVP                  RV.4       RP                  V4      # )z: z (caused by )z caused by r%   )_format_excr	   r1   r!   __name__r'   r*   )r+   	incl_name	cause_strmessager   s   &&   r"   r)    ExceptionCauseMixin._get_exc_str   sq    0	##%>>**D1CJJC@AJJy12wws|r/   c                \  < V P                   '       g   \        SV `	  4       # V P                  4       p. pV'       da   V P	                  4       pV'       d   VP                  VR .4       VP                  RVV P                  RR7      .4       RP                  V4      # V P                  RR7      # )z --- z+Wrapped traceback (most recent call last):
T)r<   r%   F)r   r   __str__r&   r1   r'   r)   r*   )r+   r,   r   r>   r!   s   &   r"   rA   ExceptionCauseMixin.__str__   s    zzz7?$$'')	'')G

GW-.JJF!))D)9; < 773<$$u$55r/    )T)r;   
__module____qualname____firstlineno____doc__r   r   r-   r1   r&   r)   rA   __static_attributes____classdictcell____classcell__r!   __classdict__s   @@r"   r   r   .   s5     " E"H
6 6r/   c                     Vf   T p\         P                  ! V P                  P                  V4      pVP	                  4       # N)r5   _format_final_exc_liner!   r;   rstrip)excr>   exc_strs   && r"   r:   r:      s5    ..s}}/E/EwOG>>r/   _BaseTBItemzfilename, lineno, name, linec                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )_TBItemc                X   < \         SV `  4       pVR V P                  ,          ,          pV# )z <%r>)r   r4   frame_id)r+   r   r!   s   & r"   r4   _TBItem.__repr__   s(    g w&&
r/   rC   )r;   rD   rE   rF   r4   rH   rI   rJ   rK   s   @@r"   rU   rU      s      r/   rU   c                   N   a  ] tR t^t o R
R ltR tR tR tR tR t	R t
R	tV tR# )_DeferredLineNc                    Wn         W n        T;'       g    / pVP                  4        UUu/ uF  w  rEVR9   g   K  WEbK  	  uppV n        R# u uppi )r;   N)r;   
__loader__)filenamelinenoitemsmodule_globals)r+   r]   r^   r`   kvs   &&&&  r"   __init___DeferredLine.__init__   sY     '--20>0D0D0F H0F'(,F'F  $qt0F H Hs
   AAc                d    V P                   V P                  3VP                   VP                  38H  # rN   r^   r]   r+   others   &&r"   __eq___DeferredLine.__eq__   '    T]]+enn/MMMr/   c                d    V P                   V P                  3VP                   VP                  38g  # rN   rf   rg   s   &&r"   __ne___DeferredLine.__ne__   rk   r/   c                0   \        V R 4      '       d   V P                  # \        P                  ! V P                  4       \        P
                  ! V P                  V P                  V P                  4      pV'       d   VP                  4       pMRpWn        V# )_lineN)	hasattrrp   	linecache
checkcacher]   getliner^   r`   strip)r+   lines   & r"   rA   _DeferredLine.__str__   sp    4!!::T]]+  !%!%!4!46 ::<DD
r/   c                *    \        \        V 4      4      # rN   )reprstrr+   s   &r"   r4   _DeferredLine.__repr__   s    CIr/   c                *    \        \        V 4      4      # rN   )lenrz   r{   s   &r"   __len___DeferredLine.__len__   s    3t9~r/   c                4    \        V 4      P                  4       # rN   )rz   ru   r{   s   &r"   ru   _DeferredLine.strip   s    4y  r/   )rp   r]   r^   r`   rN   )r;   rD   rE   rF   rc   ri   rm   rA   r4   r   ru   rH   rI   )rL   s   @r"   rZ   rZ      s0     HNN! !r/   rZ   c                    . pV f   \         P                  ! ^4      p Vf   \        \         RR4      p^ pV e   W18  d   V P                  P                  pV P
                  pV P                  P                  p\        WEV P                  4      p\        WEWg4      p\        V 4      Vn        VP                  V4       V P                  p V^,          pK  VP                  4        V# Ntracebacklimiti  )r   	_getframer   f_codeco_filenamef_linenoco_namerZ   	f_globalsrU   idrW   r(   f_backreverse)	flimitr   nr]   r^   namerv   items	   &&       r"   r   r      s    
CyMM!}-t4	A
-AI88''xxXq{{;x41

4HH	QKKMJr/   c                    . pVf   \        \        RR4      p^ pV e   W18  d   V P                  P                  P                  pV P
                  pV P                  P                  P                  p\        WEV P                  P                  4      p\        WEWg4      p\        V P                  4      Vn        VP                  V4       V P                  p V^,          pK  V# r   )r   r   r   r   r   	tb_linenor   rZ   r   rU   r   rW   r(   tb_next)	tbr   r   r   r]   r^   r   rv   r   s	   &&       r"   r   r      s    
C}-t4	A
.QY;;%%11{{!!))Xr{{/D/DEx42;;

4ZZ	QJr/   c                       ] tR tRtRtR# )	MathErrori  rC   N)r;   rD   rE   rF   rH   rC   r/   r"   r   r     s    r/   r   c                      ^^ ,          # )r   rC   rC   r/   r"   whoops_mathr     s    Q3Jr/   c                     V ^8  d   \        V ^,           R7      #  \        4       #   \         d   p\        TR4      pThRp?ii ; i)   )r   zya done messed upN)math_lolr   ZeroDivisionErrorr   )r   zderQ   s   &  r"   r   r   	  sF    1u!A#} 01	s   	& A?Ac                  ^     \        4        R#   \         d   p \        T R 4      pThRp ? ii ; i)hiN)r   
ValueErrorr   )merQ   s     r"   mainr     s-    
 D!	s   
 ,',__main__rN   )NN)r   )r   r5   rr   collectionsr   __all__r   r   r:   rS   rU   rZ   r   r   r   r   r   r   r   r;   pdbpost_mortemrC   r/   r"   <module>r      s   @    " !
!o6) o6d (FGk #! #!L**	#Z 	 z   3??$s   -A8 8B