Your IP : 216.73.216.213


Current Path : /opt/alt/python310/lib64/python3.10/test/libregrtest/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/libregrtest/__pycache__/utils.cpython-310.opt-2.pyc

o

0�i�@s�ddlZddlZddlZddlZddlmZdd�Zdd�Zdd�Z	ddd�Z
d
d�Zdadd�Z
dd�Zdd�Zdadd�Zdd�Zdd�ZdS)�N)�supportcCs�t�|d�}t|d�\}}t|d�\}}t|d�\}}g}|r'|�d|�|r0|�d|�|rG|r<|�d|�n|�d||d�|sMd|S|dd	�}d
�|�S)Ng@�@i��<z%s hourz%s minz%s secz%.1f secz%s ms�� )�mathZceil�divmod�append�join)ZsecondsZmsZminutesZhours�parts�r�=/opt/alt/python310/lib64/python3.10/test/libregrtest/utils.py�format_durations"
r
cCs>|sdSt|�D]\}}tj�|�\}}|dkr|||<qdS)Nz.py)�	enumerate�os�path�splitext)�names�idx�name�basenameZextrrr�removepy!s��rcCs |dkr
d||fSd||fS)N�z%d %sz%d %ssr)�nZwordrrr�count*sr�F�cCs<	d|}ttjd�dd�t|�D��|||d�|d�dS)Nrcss�|]}t|�VqdS�N)�str)�.0�eltrrr�	<genexpr>;s�zprintlist.<locals>.<genexpr>)Zinitial_indentZsubsequent_indent)�file)�print�textwrapZfillr	�sorted)�x�width�indentr!Zblanksrrr�	printlist1s�
�r(cCst�|�dSr)r�
print_warning)�msgrrrr)@sr)cCs0tjdur
tj��tjdurtj��dSdSr)�sys�stdout�flush�stderrrrrr�flush_std_streamsGs



�r/cCsJdt_td�tj}zt�tjt_t|�tj��W|t_dS|t_w)NTzUnraisable exception)	r�environment_alteredr)r+r.r/�
__stderr__�orig_unraisablehookr-)Z
unraisable�
old_stderrrrr�regrtest_unraisable_hookNsr4cCstjatt_dSr)r+�unraisablehookr2r4rrrr�setup_unraisable_hook\s
r6cCsTdt_td|jj���tj}zt�tjt_t	|�tj�
�W|t_dS|t_w)NTzUncaught thread exception: )rr0r)�exc_type�__name__r+r.r/r1�orig_threading_excepthookr-)�argsr3rrr�regrtest_threading_excepthookesr;cCsddl}|jat|_dS)Nr)�	threading�
excepthookr9r;)r<rrr�setup_threading_excepthookss
r>cCs`tj��D]	}t|d�r|`qtjtjtjtjfD]
}|dur#|�	�qztjd}Wn	t
y4Ynw|j��ztjd}Wn	t
yJYnw|�
�ztjd}Wn	t
y_Ynw|j��ztjd}Wn	t
yuYnw|��ztjd}Wn	t
y�Ynw|��ztjd}Wn	t
y�Ynw|��ztjd}Wn	t
y�Ynw|��ztjd	}	Wn	t
y�Ynw|	j��ztjd
}
Wn	t
y�Ynw|
��ztjd}Wn	t
y�Ynwd|_ztjd}Wn
t
�y	Ynw|��ztjd
}
Wn
t
�yYnw|
jD]}|��q#t��dS)N�__warningregistry__zdistutils.dir_util�re�	_strptimezurllib.parsezurllib.request�	linecache�	mimetypes�filecmp�struct�doctest�ctypes�typing)r+�modules�values�hasattrr?r,r.�
__stdout__r1r-�KeyErrorZ
_path_created�clear�purgeZ_regex_cacheZclear_cacheZ
urlcleanup�
clearcacheZ_default_mime_types�_cacheZ_clearcacheZmasterZ_reset_cacheZ	_cleanupsrZ
gc_collect)�mod�streamZdistutils_dir_utilr@rAZurllib_parseZurllib_requestrBrCrDrErFrGrH�frrr�clear_cacheszs�
���
��
�����
����

rU)rrN)rZos.pathrr+r#�testrr
rrr(r)r2r/r4r6r9r;r>rUrrrr�<module>s$