hxddlZddlZddlZddlZddlmZdZdZdZ ddZ d Z da d Z d Zdad Zd ZdZdS)N)supportctj|dz}t|d\}}t|d\}}t|d\}}g}|r|d|z|r|d|z|r9|r|d|zn|d||dz zz|sd|zS|dd }d |S) Ng@@i<z%s hourz%s minz%s secz%.1f secz%s ms )mathceildivmodappendjoin)secondsmsminuteshourspartss -/usr/lib/python3.11/test/libregrtest/utils.pyformat_durationrs  7S= ! !BT""KGRgr**GWGR((NE7 E ( Y&''') X'(((=  = LLG+ , , , , LLwd':; < < < | "1"IE 88E??c|sdSt|D]2\}}tj|\}}|dkr|||<3dS)Nz.py) enumerateospathsplitext)namesidxnamebasenameexts rremovepyr!s` u%%"" T((.. # %<<!E#J""rc*|dkrd||fzSd||fzS)Nz%d %sz%d %ss)nwords rcountr%*s)Avv!T""1d)##rFc d|z}ttjddt |D||||dS)zPrint the elements of iterable x to stdout. Optional arg width (default 70) is the maximum line length. Optional arg indent (default 4) is the number of blanks with which to begin each line. rc34K|]}t|VdSN)str).0elts r zprintlist..;s( ? ?cS ? ? ? ? ? ?r)initial_indentsubsequent_indent)fileN)printtextwrapfillr sorted)xwidthindentr1blankss r printlistr:1sq6\F (- ? ?VAYY ? ? ???'- I I Irc.tj|dSr*)r print_warning)msgs rr<r<@s #rcPdt_tjdtj} tjtjjt_t|tj|t_dS#|t_wxYw)NTzUnraisable exception) renvironment_alteredr<sysstderrflush_std_streams orig_stderrorig_unraisablehookflush) unraisable old_stderrs rregrtest_unraisable_hookrHGs"&G 0111J !###*6 J'''  Z s ABB%c@tjatt_dSr*)r@unraisablehookrDrHr"rrsetup_unraisable_hookrKUs,1Crcjdt_tjd|jjt j} tjtjjt _t|t j |t _dS#|t _wxYw)NTzUncaught thread exception: ) rr?r<exc_type__name__r@rArBrCorig_threading_excepthookrE)argsrGs rregrtest_threading_excepthookrQ^s"&G P 8NPPQQQJ !###*6 !$'''  Z s AB$$B2c4ddl}|jat|_dS)Nr) threading excepthookrOrQ)rSs rsetup_threading_excepthookrUls% ) 48Irc>tjD]}t|dr|`tjtjtjtjfD]}||  tjd}|j n#t$rYnwxYw tjd}| n#t$rYnwxYw tjd}|j n#t$rYnwxYw tjd}|n#t$rYnwxYw tjd}|n#t$rYnwxYw tjd}|n#t$rYnwxYw tjd}|n#t$rYnwxYw tjd } | j n#t$rYnwxYw tjd } | n#t$rYnwxYw tjd } d| _n#t$rYnwxYw tjd } | n#t$rYnwxYw tjd } | jD] }| dS#t$rYdSwxYw)N__warningregistry__zdistutils.dir_utilre _strptimez urllib.parsezurllib.request linecache mimetypesfilecmpstructdoctestctypestyping)r@modulesvalueshasattrrWstdoutrA __stdout__ __stderr__rE _path_createdclearKeyErrorpurge _regex_cache clear_cache urlcleanup clearcache_default_mime_types_cache _clearcachemaster _reset_cache _cleanups)modstreamdistutils_dir_utilrXrY urllib_parseurllib_requestrZr[r\r]r^r_r`fs r clear_cachesr{ss{!!##(( 3- . . (':sz3>3>J   LLNNN1 [)=> (..0000       [         'K ,  $$&&&&      #{>2    """"      $%56 !!####      K ,        (K ,  %%''''      +i(       X&       +i(      X&       X&!  A ACCCC        s<B(( B54B59C C-,C-1D D*)D*.E E"!E"&F FFG GGG== H  H H:: II I22 I?>I?J J*)J*.K K"!K"&L LL)r&r'N)ros.pathrr@r3testrrrr%r:r<rDrHrKrOrQrUr{r"rrr~s  2"""$$$        222 !    999aaaaar