a XC?h2@snddlZddlZddlZddlZddlmZddZddZddZ dd d Z d dZ da ddZ ddZdS)N)supportcCst|d}t|d\}}t|d\}}t|d\}}g}|rN|d||r`|d||r|rx|d|n|d||d|sd|S|dd }d |S) Ng@@i<z%s hourz%s minz%s secz%.1f secz%s ms )mathZceildivmodappendjoin)ZsecondsZmsZminutesZhourspartsr ;/opt/alt/python39/lib64/python3.9/test/libregrtest/utils.pyformat_durations" r cCs>|sdSt|D](\}}tj|\}}|dkr|||<qdS)Nz.py) enumerateospathsplitext)namesidxnamebasenameZextr r r removepy!s rcCs$|dkrd||fSd||fSdS)Nz%d %sz%d %ssr )nZwordr r r count*s rFcCs:d|}ttjdddt|D|||d|ddS)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. rcss|]}t|VqdSN)str).0eltr r r ;zprintlist..)Zinitial_indentZsubsequent_indent)fileN)printtextwrapZfillr sorted)xwidthindentr"Zblanksr r r printlist1s r)cCst|dSr)r print_warning)msgr r r r*@sr*cCs<dt_tdtj}ztjt_t|W|t_n|t_0dS)NTzUnraisable exception)rZenvironment_alteredr*sysstderr __stderr__orig_unraisablehook)Z unraisableZ old_stderrr r r regrtest_unraisable_hookGs r0cCstjatt_dSr)r,unraisablehookr/r0r r r r setup_unraisable_hookSsr2)rrN)rZos.pathrr,r$testrr rrr)r*r/r0r2r r r r s