bgXddlZddlZddlmZddlmZddlmZddlmZdedefdZ d e dedefd Z d ed e defd Z GddejZdedefdZdZedfded ee dedefdZd"dededefdZGddejZ d#dddede de dee d edef d!ZdS)$N)Any)Dict)IO)Optionalobjreturnc t|S#ttf$rt$rt |jd|dcYSwxYw)Nz("z"))reprKeyboardInterrupt SystemExit BaseExceptiontype__name__)rs e/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/_io/saferepr.py_try_repr_or_strr sn0Cyy z * 000s))$////////0s5A A excc t|}n;#ttf$rt$r}dt|d}Yd}~nd}~wwxYwd|t |jt|S)Nzunpresentable exception ()z+<[{} raised in repr()] {} object at 0x{:x}>)rr r r formatrrid)rrexc_infos r_format_repr_exceptionrsH#C(( z * HHHG/?/D/DGGGH 8 ? ?$s))$bgg  sA AA smaxsizect||krTtd|dz dz}td|dz |z }|d|dz|t||z dzS|S)Nrz...)lenmax)rrijs r _ellipsizer"sp 1vv GaKA% & & 7Q;? # #!uu}qQ!.. HcfeZdZdZd deededdffd Zdede ffd Z ded ede fd Z xZ S) SafeReprz repr.Repr that limits the resulting size of repr() and includes information on exceptions raised during the call. Fr use_asciirNczt||nd|_||_||_dS)a  :param maxsize: If not None, will truncate the resulting repr to that specific size, using ellipsis somewhere in the middle to hide the extra text. If None, will not impose any size limits on the returning repr. Niʚ;)super__init__ maxstringrr&)selfrr& __class__s rr)zSafeRepr.__init__,s? %,$7] "r#xc$ |jrt|}n!t|}n8#tt f$rt $r}t||}Yd}~nd}~wwxYw|jt||j}|SN) r&asciir(r r r r rrr")r+r-rrr,s rr z SafeRepr.repr;s /~ $!HHGGLLOO!:.     / / /&sA..AAAAAA / < #1dl++As8<A1A,,A1levelc t|}n8#ttf$rt$r}t ||}Yd}~nd}~wwxYw|jt ||j}|Sr/)r r r r rrr")r+r-r1rrs r repr_instancezSafeRepr.repr_instanceJs /QAA!:.     / / /&sA..AAAAAA / < #1dl++AsAAA)F) r __module__ __qualname____doc__rintboolr)objectstrr r3 __classcell__r,s@rr%r%&s # # #$ #4 # # # # # # f        v c c        r#r%cz tj|S#t$r}t||cYd}~Sd}~wwxYw)zReturn a pretty printed string for the given object. Failing __repr__ functions of user instances will be represented with a short exception info. N)pprintpformat Exceptionr)rrs r safeformatrAVsU 0~c""" 000%c3////////0s :5::Fr&cHt|||S)aJReturn a size-limited safe repr-string for the given object. Failing __repr__ functions of user instances will be represented with a short exception info and 'saferepr' generally takes care to never raise exceptions itself. This function is a wrapper around the Repr/reprlib functionality of the stdlib. )r%r )rrr&s rsafereprrDfs" GY ' ' , ,S 1 11r#Tc |rt|St|S#t$r}t||cYd}~Sd}~wwxYw)atReturn an unlimited-size safe repr-string for the given object. As with saferepr, failing __repr__ functions of user instances will be represented with a short exception info. This function is a wrapper around simple repr. Note: a cleaner solution would be to alter ``saferepr``this way when maxsize=None, but that might affect some other code. N)r0r r@r)rr&rs rsaferepr_unlimitedrFvse0  :: Cyy 000%c3////////0s"" AAAAc\eZdZdZdedeedededeee fdedd ffd Z xZ S) AlwaysDispatchingPrettyPrinterz;PrettyPrinter that always dispatches (regardless of width).r9streamindent allowancecontextr1rNc |jt|jd}t |}||vs|(t ||||||dSd||<||||||||dz||=dS)N) _dispatchgetr__repr__rr(_format) r+r9rIrJrKrLr1pobjidr,s rrRz&AlwaysDispatchingPrettyPrinter._formats N  tF||4d ; ;6  G  qy GGOO     F $ 7EAIFFF ENNNr#) rr4r5r6r9rr:r7rrrRr;r<s@rrHrHsEE3    c3h  r#rHrNP)compactr9rJwidthdepthrVcNt|||||S)N)rJrWrXrV)rHr?)r9rJrWrXrVs r_pformat_dispatchrZs/ *U%    gfoor#)T)rNrUN)r>reprlibtypingrrrrr9r:rr rr7r"Reprr%rADEFAULT_REPR_MAX_SIZEr8rDrF PrettyPrinterrHrZr#rrasE 0&0S0000  F s     #      -----w|---` 0F 0s 0 0 0 0+@SX 2 2  2"3- 2LP 2 2 2 2 2 00F0t0s0000&V%9F            C=          r#