Qf ddlZddlZddlZddlZddlZddlmZgdZd8dZ dZ d9dZ d8dZ d8dZ d Zd ZGd d ZeZd ZeedddfdZeeddfdZefdZdZefdZd:dZd;dZd:dZdselfs r#__repr__z_Sentinel.__repr__[sr%N)__name__ __module__ __qualname__r9r6r%r#r4r4Zsr%r4c|tu|tuk7r td||cxurturIn||fS|@t|tr||jfSt dt |jdy||fS)Nz-Both or neither of value and tb must be givenzException expected for value, z foundNN) _sentinel ValueError isinstance BaseException __traceback__ TypeErrortyper:)excvaluer,s r#_parse_value_tbrH`s i0HII i "9 ?#}-C----<#Cy112&:; ; "9r%Tc~ t|||\}}tt||||d}|j||y)NTr+compactrchain)rHrrEr )rFrGr,r+rrMtes r#r r osA  UB/IE2 DK% NBHH$eH$r%c t|||\}}tt||||d}t|j |S)NTrJrM)rHrrElistr)rFrGr,r+rMrNs r#rrsG UB/IE2 DK% NB   & ''r%cz |tur|}tt||dd}t|j S)NT)rK)r?rrErQr)rFrGrNs r#rrs>   DKd CB ((* ++r%cDt|d}||sd|z}|S|d|d}|S)N exceptionz%s z:  ) _safe_string)etyperGvaluestrlines r#_format_final_exc_linerZs6E;/H }H~ K#H- Kr%cH ||S#d|d|jdcYSxYw)N< z () failed>)r:)rGwhatfuncs r#rVrVs14E{44&$-- 33s !cH ttj|||y)Nr+rrM)r rrTras r#r r sOCMMO5t5Ir%cb djttj||S)Nrr+rM)joinrrrTrcs r#r r s$/ 77#CMMO5N OOr%c* ttdsttds tdttdrttj|||yttj tj tj|||y)Nlast_exc last_typezno last exception)hasattrrr@r rfrg last_valuelast_tracebackras r#rrscV 3 #GC,E,--sJ eT59 s~~s7I7ItU ,r%cv |tjj}tt |||yr))r _getframef_backr$r)fr+rs r#rrs0  y MMO " "}Qe,48r%cp |tjj}tt ||Sr.)rrlrmrr)rnr+s r#r r s-?y MMO " " }Qe4 55r%c |tjj}tj t ||}|j |Sr.)rrlrmrextractrreverse)rnr+stacks r#rrsF y MMO " "  Ae )r{r|r)rr{r|rr7s r#r9zFrameSummary.__repr__1s0HOO]]4;;TYYPH Hr%cy)Nr6r7s r#__len__zFrameSummary.__len__5sr%c2|j|jSr')rYrr7s r#_original_linezFrameSummary._original_line8s zzr%c|j<|jytj|j|j|_|jj Sr')rr| linecachegetliner{stripr7s r#rYzFrameSummary.line>sH :: {{""**4==$++FDJzz!!r%) r:r;r< __slots__rrrrr9rpropertyrrYr6r%r#rrsi ,I?Cd44#0GHH ""r%rc#K |.extended_frame_gens)& 6&$d333'sr)r1)klassrr+rrrs ` r#rqzStackSummary.extractys4  455  L)6+ +r%c \|ttdd}||dkrd}|4|dk\rtj||}nt j || }|}t }|D]\}\}} } } |j} | j} | j}|j| tj| |j|r |j}nd}|jt!| ||d|| | | |D]} tj"| |r|D]}|j$|S)Ntracebacklimitr)maxlenF)rrr}r~r)getattrrrr collectionsdequesetr co_filenameco_nameaddr lazycache f_globalsf_localsappendr checkcacherY)rrr+rrresultfnamesrnr|r}r~rcor{rrs r#r1z-StackSummary._extract_from_extended_frame_gens+ =C!148E UQY  z%,,Y> '--iG 9B 5A5 E9B~~H::D JJx   !++ 6:: MM,&$E(%UiI J:CH   *  r%c  t}|D]I}t|tr|j|%|\}}}}|jt||||K|S)NrY)rrArr)ra_listrframer{r|rrYs r#rzStackSummary.from_lists\ E%. e$/4,&$ l8VTMN   r%c* g}|jdj|j|j|j|j rM|j j }|jdj||j}t|}t|j j}||z }|j|jt||j}t||j} ||| } d} |j|jk(r$tt5t!| } dddnt|j#} | |z t|ks | r| j$| j&z dkDrt)||dz} t)|| dz} |jd|jd| |z z| rt)| | j&}t)| | j$}|j| j*|z|j| j,||z z|j| j*| | z |z zn|jd| | z z|jd|j.rMt1|j.j3D]'\}}|jd j|| )d j5|S#1swYxYw) Nz File "{}", line {}, in {}  {} rrz r]^rUz {name} = {value} )rrGr)rrr{r|rrYrrlenlstripr~r _byte_offset_to_character_offsetr}r Exception(_extract_caret_anchors_from_line_segmentrstripright_start_offsetleft_end_offset_display_width primary_charsecondary_charrsortedrrd)r8 frame_summaryrow stripped_linerY orig_line_lenframe_line_lenstripped_characters start_offset end_offset code_segmentanchorsdp_start_offset dp_end_offsetdp_left_end_offsetdp_right_start_offsetrrGs r#format_frame_summaryz!StackSummary.format_frame_summarys  299  " "M$8$8-:L:LN O   )..446M JJz((7 8 //DIM !3!3!:!:!<=N"/."@ ##/!++7?--- / =-113 #L<  ''=+C+CC!),"J<"X-, "%T[[]!3J ,s=/AAG$>$>AXAX$X[\$\'5T<&H1&LO$24$Dq$HMJJv&JJso8K&KLM-;L'JaJa-b*0>|WMgMg0h- 7#7#7:L#LM 7#9#9=RUg=g#hi 7#7#7=?;Z]r;r#st 3-/*I#JKJJt$   %m&:&:&@&@&BC e 3::E:RS Dwws|E-,s ? LLc g}d}d}d}d}|D]}|j|}||1||jk7s"| ||jk7s|||jk7rW|tkDr(|tz}|j d|d|dkDrdndd|j}|j}|j}d}|dz }|tkDr|j ||tkDr(|tz}|j d|d|dkDrdndd|S)Nrz [Previous line repeated z more timersrz] )rr{r|r_RECURSIVE_CUTOFFr)r8r last_file last_line last_namecountrformatted_frames r#rzStackSummary.format sR    !M"77 FO&!Y-2H2H%H!Y-2F2F%F!Y-2D2D%D,,..EMM4UG<&+aisR8=*22 )00 )..  QJE(( MM/ *)", $ $ & &E MM,UG4#aisR05  r%) r:r;r< classmethodrqr1rrrr6r%r#rrvs[I+/d ++*DHe''R$?B-r%rcb|jd}t|d|jddS)Nzutf-8replace)errors)encoderdecode)stroffsetas_utf8s r#rr=s2jj!G ww&&wy&A BBr%_Anchors)rrrr~r)defaultsctddl} |j}t|jdk7ryfd}|jd}||j dxS\}|x|j dx!\||jj}||jj}||}t|t|jz } |jj| z} | dz} | dzt|kr|| dzjs| dz } | tkrL| x} js| dvr3| dz } | dz } | tkr| x} jr.| dvr3t|| || S|jdx \||jj} ||j jdz} | tkrI| x} js| dk7r/| dz } | tkr| x} jr)| dk7r/| tkrI| x} js| dk7r/| dz } | tkr| x} jr)| dk7r/| tkr| dz } t| | Syy#t$rYywxYw)Nrrct|Sr')r)rsegments r#z:_extract_caret_anchors_from_line_segment..Xs ?Pr%r6z)#[])astparse SyntaxErrorrbodyExprBinOpleftend_col_offsetright col_offsetrisspacer SubscriptrGslice) r rtree normalize statementexproperator_start operator_end operator_stroperator_offset left_anchor right_anchorchs ` r#rrMsyy! 499~PI ! I  XX^ SYY[%.tyy/G/G%HN#,TZZ-B-B#CL#*>,#GL&),&7#l>Q>Q>S:T&TO"&))":":_"LK#.?L'!+c,.?? ,_q-@ A I I K$) %G 4AU;U2:^:^:`dfjndn#q( $) &G 4AU;U2:^:^:`dfjndn$Ik$:Il>% ?> Q sJ++ J76J7WFc` |jr|Sddltfd|d|DS)Nrc3TK|]}j|tvrdnd!yw)rrN)east_asian_width_WIDE_CHAR_SPECIFIERS).0char unicodedatas r# z!_display_width..s1!D ) )$ /3H HaO!s%()isasciir/sum)rYrr/s @r#rr~s<I  ||~  &M r%c eZdZdZdZddZy)_ExceptionPrintContextc>t|_d|_d|_y)NrF)rseenexception_group_depth need_closer7s r#rz_ExceptionPrintContext.__init__sE %&"r%c&dd|jzzS)Nr]r)r7r7s r#indentz_ExceptionPrintContext.indentsa$44455r%Nc#K|d}|j}|jr||dzz }t|trt j||dy|D]}t j||dyw)N|r]cyNTr6rs r#r z-_ExceptionPrintContext.emit..Tr%cyr>r6rs r#r z-_ExceptionPrintContext.emit..r?r%)r:r7rArtextwrap)r8text_gen margin_char indent_strtexts r#emitz_ExceptionPrintContext.emitsp  K[[]  % % ++ +J h $//(J8IJ J oodJ8IJJ!sA6A8r')r:r;r<rr:rFr6r%r#r4r4s 6 Kr%r4cpeZdZ dddddddddZedZd Zd Zd Zd Z d Z ddddZ ddddZ y)rNTF )r+rrrKmax_group_widthmax_group_depth_seenc p | du} | t} | jt|||_| |_t j t|||||_||_ t|d|_ t|dd|_ |rt!|t"r|j$|_|j&} | t)| nd|_|j*}| t)|nd|_|j,|_|j.|_|j0|_|j2|_n|rSt!|t4rCt|dd6t|dd}t7|||}|r|xjd|dz c_ n|rt!|t8t:frt|ddt|dd}t7|||}|r|xjd|dz c_ t!|t8rVt|dd}|G|t<j>vr5|r|xjd |d z c_ n|xjd |d z c_ |r|jA| |jBnd |_!| s||fg}|r |jE\}} | ri| jF]t| jF| vrFtItK| jF| jF| jFjL||||| | }nd}|r|duxr| duxr | jB }nd}| rk| jN_|r]t| jN| vrFtItK| jN| jN| jNjL||||| | }nd}| r\tQ| tRrLg}| jTD]:}tItK|||jL||||| | }|jW|<nd}||_#||_'||_*|r'|jW|jF| jFf|r'|jW|jN| jNf|r/|jYt[|jT| jT|r yyy#t$r%} dt| dtg|_ Yd} ~ %d} ~ wwxYw)NrrT __notes__z!Ignored error getting __notes__: name_fromz. Did you mean: 'z'?rz Or did you forget to import ''z. Did you forget to import 'F)r+rrrJrKrLT).rridrJrKrr1r2rsexc_typerV_strrrNrr issubclassrr{r|rr}rErrmsg ImportError_compute_suggestion_error NameErrorAttributeErrorrstdlib_module_names _load_lines__suppress_context__pop __cause__rrErC __context__rABaseExceptionGroup exceptionsrextendzip)r8rR exc_value exc_tracebackr+rrrKrJrKrLis_recursive_callelnoend_lno wrong_name suggestionqueuerNcause need_contextcontextrarFtexcs r#rzTracebackException.__init__so"- =EE "Y- ..!BB ( 7l)C+ ! !K8  Z$Y TBDN  8[9%..DM""C&)o#c(4DK**G.5.Ac'ltDO!DI#**DK'22DO }}DH *X{; ;5A K>J29mZXJ 0 B?? *X >/JK 640< FD9J29mZXJ 0 B?? (I.$Y= )jC(>$>!$(L!--3$AMM):%)G0Q]]+  33#%1'5(7(7# %G#GA'9:!#J ||1 I--"')5+9,;,;"' )#))$/ ,"&J$ !( * LL",, !<=LL"..!--!@ALLR]]ALL!AB!S Z3LKQU4V3WXZDNN Zs9R R5R00R5cF |t|||jg|i|Sr')rErC)clsrFargskwargss r#from_exceptionz!TracebackException.from_exceptionSs(<49c3#4#4FtFvFFr%c@ |jD]}|jyr')rsrY)r8rs r#r[zTracebackException._load_linesXsEZZE JJ r%c`t|tr|j|jk(StSr')rAr__dict__rrs r#rzTracebackException.__eq__]s& e/ 0==ENN2 2r%c|jSr')rSr7s r#__str__zTracebackException.__str__bs yyr%c#6K |jtd|jy|jj}|jj}|dvrt |t sd}|dz|z}t|jtst||jn|j|Ed{t |jtjjrht |jt tfsH|jD]8}t|d}|j!dDcgc]}|dz c}Ed{:y|j.dj#t|jdt$yy7cc}w7Iw) N)__main__builtinsz .noterUz{} rNr)rRrZrSr<r;rArrTr_format_syntax_errorrNrabcSequencebytesrVsplitrr)r8stypesmodrls r#rz(TracebackException.format_exception_onlyesJ  == (tyy9 9  **}}'' / /dC("3J&E$--5( : :007 7 7 t~~{'?'? @t~~U|<#D&1.2jj.>?.>AH.>???'^^ '-- T^^[t TU U( 8@?s2B8F:F;BF; FF FAFFc#K d}|j-dj|jxsd|jn'|jdj|j}|j}||j d}|j d}t |t |z }dj||j|j}|jdvr |jn|}||k(s|d k(r|d z}|d z |z } |d z |z } | d k\r8d |d| D} d jdj| d| | z zdz|jxsd} dj|| |yw)Nrz File "{}", line {} zz ({})rUz r>Nrrrc3DK|]}|jr|ndyw)r]N)r)r-cs r#r0z:TracebackException._format_syntax_error..s!U}! 1#<}s z {}{}rzz {}: {}{} ) r|rr{rErrrrrrdrU) r8rfilename_suffixrErtextltextspacesrrr~r caretspacerUs r#rz'TracebackException._format_syntax_errorsq> ;; "*11 +T[[: : ]] &%nnT]];Oyy  KK%ELL)EZ#e*,F##E* *{{&04y0PT__V\ Z':+;!'!J V+&NV3 A:!UuVe}!UJ$++BGGJ,?#UZIZB[^bBbddhh11!!%o>>sE4E6rM_ctxc #K | t}g}|}|ri|rz|jt}|j}n/|j|jst }|j}nd}d}|j ||f|}|rfn|j d|ft|D]\}}||j|Ed{|j~|jrJ|jdEd{|j|jjEd{|j|jEd{|j|jkDr(|jd|jdEd{|jdk(}|r|xjdz c_ |jrP|jd|rdndEd{|j|jjEd{|j|jEd{t|j} | |j kr| } n|j dz} d |_t%| D]} | | dz k(} | rd |_|j | |j k\} nd } | s| dznd }|j'| dk(rd nd zd|dz|xjdz c_ | s)|j| j||Ed{n8| |j z }|dkDrdnd}|jd|d|dEd{| r(|j"r|j'dzd |_|xjdzc_ |sd|_ y7777j7,77777ow)Nz#Traceback (most recent call last): z... (max_group_depth is z) rrz3Exception Group Traceback (most recent call last): +)rCFTz...z+-z z+---------------- z ---------------- rrrzand z more exceptionrUz&+------------------------------------ )r4r^_cause_messager_r\_context_messagerreversedrFrarsrrr7rKrrJr8ranger:)r8rMroutputrF chained_msg chained_excrU is_toplevelnum_excsnirf truncatedtitle remainingplurals r#rzTracebackException.formats  <)+D ==,"0K"%--Koo222"2K"%//K"&K"&K {C01! MM4+ & (HC99S>))~~%99#yy)OPPP#yy)9)9);<<<99S%>%>%@AAA++d.B.BB99.t/C/C.DCHJJJ $99Q> ..!3.99#yyN-8cd ) DDD $yy)9)9);<<<99S%>%>%@AAAs~~.t333 A,,q0A"'qA !QqSH*.++7%&$*>*>%> $) ,5qse5E;;=$%qDDd4/w6IJKL..!3.$#&>>!#4#;#;%d#;#SSS$,t/C/C$C (1A 2#'99"9+_VHBG$III DOO#{{}H IJ*/..!3.7":12D.}))Q<AJD=A.TIsA;O>AO O'O*O-O0O3O6O9O<O>OrLct |tj}|j|D]}t||dy)NrPrr)rrrr )r8rrMrYs r#r zTracebackException.prints4E <::DKKeK,D $Tr *-r%) r:r;r<rrrur[rrzrrrr r6r%r#rrsq$LEIeU$CCJGG  %VN"?H#b3J!+r%ri(rrch||k(ry|j|jk(rtStS)Nr)lower _CASE_COST _MOVE_COST)ch_ach_bs r#_substitution_costr#s, t| zz|tzz|# r%ch|t|tsyt|tr|j} t |}nt|t r" t|j}t |}n|y|j|j}|j|j}t|jt|jzt|jz}d|jvr |jd}t||rd|St!|t"kDryt!|}|t$kDry|} d} |D]Q} | |k(r t!| |zdzt&zdz} t)| | dz } t+|| | } | | kDrF| r| | ksN| } | } S| S#t $rYywxYw#t $rYywxYw)Nr8zself.rr)rArrYobjdirrrV __import__rrxrurQrr f_builtinsrhr_MAX_CANDIDATE_ITEMS_MAX_STRING_SIZErmin_levenshtein_distance)rdr,rjrdmodrr8wrong_name_len best_distancerk possible_name max_distancecurrent_distances r#rWrW+sJ!<)^,mm CA I{ + Y^^,CCA :jj$Bjj$   5??# $5##$ %  U^^ #>>&)DtZ(zl++ 1v$$_N(("MJ J & M*^;a?:MQRR <):; 0]LY l * - =&J,M i     s# F F% F"!F"% F10F1c  ||k(ryd}||dr+||dr&||||k(r|dz }||dr||dr ||||k(r||d}||d}d}|d|xsdrC|d|xsdr:||dz ||dz k(r)|dz}|d|xsdr|d|xsdr||dz ||dz k(r)|d|xsd}|d|xsd}|r|stt|t|zzSt|tkDst|tkDr|dzSt|t|kr||}}t|t|z tz|kDr|dzStt ttt|dzzt}d}t t|D]}||}|tzx} }t j } t t|D]E} | t||| z} || } t|| tz} t| | }||| <|| ksD|} G| |kDs|dzcS|Sr) rrrrQrrmaxsizerr)abmax_costprepostrrbindexbchardistanceminimumindex substitute insert_deletes r#rrise Av C CD'ag!C&AcF"2 q CD'ag!C&AcF"2 #$A #$A D MT\T q$,$/Ad1fI464J   MT\T q$,$/Ad1fI464J -4<4A -4<4A ASVc!f_-- 1v  CF-=$=!| 1vA!1 AQ:%0!| uZs1vz!:JG HC FA-& "Z//6++3q6]E!$6uah$GGJ5zH 1J>M 3F CJ # X a< ) * Mr%r'r>)NNTr>)NNN)7collections.abcrrrrrA contextlibr__all__r$rrr rrrr4r?rHr rrrZrrVr r rrr rrrrrr2rrrQrr namedtuplerrr,rr4rrrrrrrWrr6r%r#rsF  $' ;$707*& &  K  #, T%"$-$ ()2,&$'4JP , 96  L"L"^  OD4DNC "; ! ! 3Z -^$KK.s+s+l    ;|:r%