Mini Shell

Direktori : /opt/cppython/lib/python3.8/test/__pycache__/
Upload File :
Current File : //opt/cppython/lib/python3.8/test/__pycache__/pythoninfo.cpython-38.pyc

U

��eg_Q�@s�dZddlmZddlZddlZddlZddlZddlZdd�ZGdd�d�Z	dd�d	d
�Z
dd�Zdd�d
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#d=d>�Z$d?d@�Z%dAdB�Z&dCdD�Z'dEdF�Z(dGdH�Z)dNdIdJ�Z*dKdL�Z+e,dMk�r|e+�dS)OzK
Collect various information about Python to help debugging test failures.
�)�print_functionNcCs*|dkrdSt|�}t�dd|�}|��S)Nz\s+� )�str�re�sub�strip)�text�r	�./opt/cppython/lib/python3.8/test/pythoninfo.py�normalize_texts
rc@s$eZdZdd�Zdd�Zdd�ZdS)�
PythonInfocCs
i|_dS�N)�info��selfr	r	r
�__init__szPythonInfo.__init__cCs\||jkrtd|��|dkr"dSt|t�sNt|t�s>t|�}|��}|sNdS||j|<dS)Nzduplicate key: %r)r�
ValueError�
isinstance�intrr)r�key�valuer	r	r
�adds


zPythonInfo.addcCsdd�|j��D�S)zU
        Get information as a key:value dictionary where values are strings.
        cSsi|]\}}|t|��qSr	)r)�.0rrr	r	r
�
<dictcomp>.sz(PythonInfo.get_infos.<locals>.<dictcomp>)r�itemsrr	r	r
�	get_infos*szPythonInfo.get_infosN)�__name__�
__module__�__qualname__rrrr	r	r	r
rsr��	formattercCsH|D]>}t||d�}|dkrq||}|dk	r8|||�}|||�qdSr
)�getattr)�info_add�objZname_fmt�
attributesr �attrr�namer	r	r
�copy_attributes1s
r'cCs4zt||�}Wntk
r$YdSX|||�dSr
�r!�AttributeError)r"r&�modZ	attr_namerr	r	r
�	copy_attr<s
r+cCsJzt||�}Wntk
r$YdSX|�}|dk	r<||�}|||�dSr
r()r"r&r*�	func_namer �funcrr	r	r
�	call_funcDsr.cCs�d}t|td|�t|dtd�t|dtd�t��}ttd�rPd|t��f}|d	|�d
D]T}tt|�}|dkrvq^t|dd�}|s�q^t|dd�}|r�d||f}|d
||�q^ttd�}|r�d}nd}|d|�dS)N)�
_framework�abiflags�api_version�builtin_module_names�	byteorder�dont_write_bytecode�
executable�flags�
float_info�float_repr_style�	hash_info�
hexversion�implementation�int_info�maxsize�
maxunicode�path�platform�prefix�thread_info�version�version_infoZwinverzsys.%szsys.androidapilevel�getandroidapilevelzsys.windowsversionZgetwindowsversion�getfilesystemencodeerrorsz%s/%szsys.filesystem_encoding)�stdin�stdout�stderr�encoding�errorszsys.%s.encodingZgettotalrefcountz$Yes (sys.gettotalrefcount() present)z#No (sys.gettotalrefcount() missing)�Py_DEBUG)r'�sysr.�getfilesystemencoding�hasattrrFr!)r"r$rJr&�streamrKrLrr	r	r
�collect_sysOs0



rQcCslddl}|��}d�tt|��}|d|�|d|���|d|jdd��d|����}|rh|d	|�dS)
Nrrzplatform.architecturezplatform.python_implementationzplatform.platformT)Zaliasedz%s %szplatform.libc_ver)r@Zarchitecture�join�filter�boolZpython_implementation�libc_verr)r"r@ZarchrUr	r	r
�collect_platform�s
�
�rVcCsddl}|d|�d��dS)Nrzlocale.encodingF)�locale�getpreferredencoding)r"rWr	r	r
�collect_locale�srYcCs$|dt�d��|dt�d��dS)Nzbuiltins.float.float_format�floatzbuiltins.float.double_formatZdouble)rZ�
__getformat__)r"r	r	r
�collect_builtins�sr\c
Cs�ddl}t|d�r�zPz|�d|j�d}Wn*tk
rT}zd|}W5d}~XYnX|d|�Wn0tk
r�}z|jtjkr��W5d}~XYnXdS)Nr�	getrandom�zready (initialized)znot seeded yet (%s)zos.getrandom)�osrOr]�
GRND_NONBLOCK�BlockingIOError�OSError�errnoZENOSYS)r"r_�state�excr	r	r
�collect_urandom�s
rfcCsXddl}dd�}d}t||d||d�t|d|d�t|d	|d
�t|d|d�t|d
|d�dd�}t|d|d|d�t|d�r�z|��}Wntk
r�YnX|d|�t|d|d�t|d|d�td�}|j��D]H\}}|�	�}	|	|k�s|	�
d��s|	�
d�r�|	�d�r�|d||�q�t|d��rT|�d�}
|�|
�|dd |
�dS)!NrcSs&|dkrttdd�|D���S|SdS)N)�supports_follow_symlinks�supports_fd�supports_effective_idscss|]}|jVqdSr
)r)rr-r	r	r
�	<genexpr>�sz2collect_os.<locals>.format_attr.<locals>.<genexpr>)r�sorted�r%rr	r	r
�format_attr�szcollect_os.<locals>.format_attr)r&�supports_bytes_environrirhrgzos.%srz	os.getcwd�getcwdz	os.getuid�getuidz	os.getgid�getgidzos.uname�unamecSsd�tt|��S)N�, )rR�mapr)�groupsr	r	r
�
format_groups�sz!collect_os.<locals>.format_groupszos.getgroups�	getgroups�getloginzos.loginzos.cpu_count�	cpu_countz
os.getloadavg�
getloadavg)>�APPDATAZARZ	ARCHFLAGSZARFLAGSZAUDIODEV�CC�CFLAGS�COLUMNSZCOMPUTERNAMEZCOMSPECZCPPZCPPFLAGSZDISPLAYZDISTUTILS_DEBUGZDISTUTILS_USE_SDKZDYLD_LIBRARY_PATHZENSUREPIP_OPTIONSZHISTORY_FILE�HOMEZ	HOMEDRIVEZHOMEPATHZIDLESTARTUP�LANGZLDFLAGSZLDSHAREDZLD_LIBRARY_PATH�LINESZMACOSX_DEPLOYMENT_TARGETZMAILCAPSZ	MAKEFLAGSZMIXERDEVZMSSDK�PATH�PATHEXTZPIP_CONFIG_FILEZPLATZPOSIXLY_CORRECTZ
PY_SAX_PARSERZProgramFileszProgramFiles(x86)ZRUNNING_ON_VALGRINDZ
SDK_TOOLS_BINZSERVER_SOFTWARE�SHELL�SOURCE_DATE_EPOCHZ
SYSTEMROOT�TEMPZTERMZTILE_LIBRARYZTIX_LIBRARY�TMP�TMPDIRZTRAVISZTZZUSERPROFILEZVIRTUAL_ENVZWAYLAND_DISPLAYZWINDIRZ_PYTHON_HOST_PLATFORMZ_PYTHON_PROJECT_BASEZ_PYTHON_SYSCONFIGDATA_NAME�__PYVENV_LAUNCHER__)ZPYTHON�LC_ZVSZ	COMNTOOLSzos.environ[%s]�umaskzos.umaskz%03o)
r_r'r.rOrxrb�	frozenset�environr�upper�
startswith�endswithr�)r"r_rmr$rvZloginZENV_VARSr&rrr�maskr	r	r
�
collect_os�sB

@
���

r�cCs�zddl}Wntk
r"YdSXddl}|��}z|�|�}Wntk
rZd}YnX|d||dk	rp|nd�|dkr�dSt|d�r�|�|j|j	�}d�
tt|��}|d|�dS)Nrzpwd.getpwuid(%s)z
<KeyError>�getgrouplistrszos.getgrouplist)
�pwd�ImportErrorr_rp�getpwuid�KeyErrorrOr��pw_name�pw_gidrRrtr)r"r�r_�uid�entryrur	r	r
�collect_pwd5s&
�
r�cCs�zddl}Wntk
r"YdSXdd�}d}t||d||d�t|d�s~t|dd	�}d
|krl|dd
�nd|kr~|dd�dS)
NrcSst|t�rd|S|SdS)Nz%#x)rrrlr	r	r
rmVs
z%collect_readline.<locals>.format_attr)Z_READLINE_VERSIONZ_READLINE_RUNTIME_VERSION�_READLINE_LIBRARY_VERSIONzreadline.%srr��__doc__�zlibedit readlinezreadline.libraryzGNU readline)�readliner�r'rOr!)r"r�rmr$�docr	r	r
�collect_readlinePs
�
r�cCsrddl}z8|jdddg|j|jdd�}|��d}|jr>WdSWntk
rVYdSX|��d}|d|�dS)NrZgdbz-nx�	--versionT�rHrI�universal_newlinesZgdb_version)�
subprocess�Popen�PIPE�communicate�
returncoderb�
splitlines)r"r��procrCr	r	r
�collect_gdbms�
r�cCsxzddl}Wntk
r YnXd}t||d|�zddl}Wntk
rTYn X|��}|�dd�}|d|�dS)Nr)Z
TK_VERSIONZTCL_VERSIONz
tkinter.%sr�
patchlevelztkinter.info_patchlevel)�_tkinterr�r'�tkinterZTcl�call)r"r�r$r�Ztclr�r	r	r
�collect_tkinter�sr�c
Cs�ddl}|d|���d}t||d|�t|d�r�dD]N}z&tjdd��|�|�}W5QRXWntk
rtYq6X|d	||�q6dS)
Nrz	time.time)�altzone�daylight�timezone�tznameztime.%s�get_clock_info)�clock�	monotonic�perf_counter�process_time�thread_time�timeT)�recordztime.get_clock_info(%s))r�r'rO�warnings�catch_warningsr�r)r"r�r$r�Z
clock_infor	r	r
�collect_time�s
r�cCs8zddl}Wntk
r"YdSX|d|j���dS)Nrzdatetime.datetime.now)�datetimer�Znow)r"r�r	r	r
�collect_datetime�s
r�cCsDddl}dD]2}|�|�}|dkr(|s(qt|�}|d||�qdS)Nr)ZABIFLAGS�ANDROID_API_LEVELr|ZCCSHAREDr}ZCFLAGSFORSHAREDZCONFIG_ARGSZ
HOST_GNU_TYPEZMACHDEPZ	MULTIARCHZOPTZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_CORE_LDFLAGSZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_STDMODULE_CFLAGSrLZPy_ENABLE_SHAREDr�ZSOABIrAr�z
sysconfig[%s])�	sysconfig�get_config_varr)r"r�r&rr	r	r
�collect_sysconfig�s
r�c	Cs4ddl}zddl}Wntk
r*YdSXzddl}Wntk
rPd}YnXdd�}d}t||d||d�d|��fd|��fd	|��ffD]"\}}d
}t||d|�d�|�q�d
dg}|dk	r�t|d�r�|�	�}	|�
|	d|	df�|D]<}z|j|}
Wntk
�rYq�YnX|d||
�q�dS)NrcSs|�d�rd|S|SdS)NZOP_z%#8x�r�rlr	r	r
rm�s
z collect_ssl.<locals>.format_attr)ZOPENSSL_VERSIONZOPENSSL_VERSION_INFOZHAS_SNIZOP_ALLZ
OP_NO_TLSv1_1zssl.%sr�
SSLContextZdefault_https_contextZstdlib_context)Zminimum_versionZmaximum_version�protocol�optionsZverify_modezssl.z.%sZOPENSSL_CONFZ
SSLKEYLOGFILE�get_default_verify_paths�zssl.environ[%s])
r_�sslr��_sslr'r�Z_create_default_https_contextZ_create_stdlib_contextrOr��extendr�r�)r"r_r�r�rmr$r&�ctxZ	env_names�partsrr	r	r
�collect_ssl�s8



�
r�cCsddl}|��}|d|�dS)Nrzsocket.hostname)�socket�gethostname)r"r��hostnamer	r	r
�collect_socketsr�cCs:zddl}Wntk
r"YdSXd}t||d|�dS)Nr)rCZsqlite_versionz
sqlite3.%s)�sqlite3r�r')r"r�r$r	r	r
�collect_sqlitesr�cCs:zddl}Wntk
r"YdSXd}t||d|�dS)Nr)�ZLIB_VERSION�ZLIB_RUNTIME_VERSIONzzlib.%s)�zlibr�r')r"r�r$r	r	r
�collect_zlib!sr�cCs>zddlm}Wntk
r&YdSXd}t||d|�dS)Nr)�expat)Z
EXPAT_VERSIONzexpat.%s)Zxml.parsersr�r�r')r"r�r$r	r	r
�
collect_expat+sr�cCs:zddl}Wntk
r"YdSXd}t||d|�dS)Nr)Z__libmpdec_version__z_decimal.%s)�_decimalr�r')r"r�r$r	r	r
�collect_decimal5sr�cCsDzddl}Wntk
r"YdSXt|d|d�t|d|d�dS)Nrzpymem.allocatorZpymem_getallocatorsnamezpymem.with_pymallocZ
WITH_PYMALLOC)�	_testcapir�r.r+)r"r�r	r	r
�collect_testcapi?sr�cCstzddl}Wntk
r"YdSXdd�t|�D�}|D]&}t||�}|�|�}|d||�q:t|d|d�dS)NrcSsg|]}|�d�r|�qS)ZRLIMIT_r�)rr%r	r	r
�
<listcomp>Os
z$collect_resource.<locals>.<listcomp>zresource.%szresource.pagesizeZgetpagesize)�resourcer��dirr!Z	getrlimitr.)r"r�Zlimitsr&rrr	r	r
�collect_resourceIs

r�cCsLzddlm}Wntk
r&YdSXdd�t|�D�}t||d|�dS)Nr)�test_socketcSsg|]}|�d�r|�qS)ZHAVE_r�)rr&r	r	r
r�_s
�z'collect_test_socket.<locals>.<listcomp>ztest_socket.%s)�testr�r�r�r')r"r�r$r	r	r
�collect_test_socketXsr�cCsZzddlm}Wntk
r&YdSXd}t||d|�t|d|d�t|d|d�dS)	Nr)�support)ZIPV6_ENABLEDztest_support.%sztest_support._is_gui_availableZ_is_gui_availablez test_support.python_is_optimizedZpython_is_optimized)r�r�r�r'r.)r"r�r$r	r	r
�collect_test_supportdsr�c	Cs�ddl}ddl}|�d�}|s"dSzddl}|�|�}Wntk
rT|��}YnX|�d�z|j||j|j	dd�}Wnt
k
r�YdSX|��d}|jr�dS|�
�d}t|�}|d|�dS)Nrr|r�Tr�z
CC.version)r�r�r��shlex�splitr��appendr�r��STDOUTrbr�r�r�r)	r"r�r�r|r��argsr�rHrr	r	r
�
collect_ccqs2

�
r�cCsBzddlm}Wntk
r&YdSX|dd�tt|���dS)Nr)�
_GDBM_VERSIONzgdbm.GDBM_VERSION�.)�_gdbmr�r�rRrtr)r"r�r	r	r
�collect_gdbm�s
r�cCspzddlm}Wntk
r&YdSX|�}t|�D]4}||}t|�D]}|d||ft||��qJq6dS)Nr)�get_configsz%s[%s])Z_testinternalcapir�r�rk�repr)r"r�Zall_configsZconfig_typeZconfigrr	r	r
�collect_get_config�sr�cCsddl}t||dd�dS)Nrz
subprocess.%s)�_USE_POSIX_SPAWN)r�r')r"r�r	r	r
�collect_subprocess�sr�c	Cs�zddl}Wntk
r"YdSXt|d�s2dS|�d�}|j}z
|j}Wntk
rdd}YnX||_d|_t	|��}|d|�z"ddl
}|�tj
�}|d|�Wnttfk
r�YnXdS)Nr�WinDLL�ntdllz<function not available>r	zwindows.RtlAreLongPathsEnabledzwindows.dll_path)�ctypesr�rOr�Zc_ubyte�RtlAreLongPathsEnabledr)ZrestypeZargtypesrT�_winapiZGetModuleFileNamerMZ	dllhandle)r"r�r�ZBOOLEANr��resrZdll_pathr	r	r
�collect_windows�s,





rcCs�d}|j}ttttttttt	t
ttt
tttttttttttttttfD]p}z||�WqFtk
r�}z@d}td|jt j!d�t"j#t j!d�tt j!d�t j!�$�W5d}~XYqFXqF|S)NFTzERROR: %s() failed��file)%rrfr\r�r�r�r�r�r�r�rYr�rVr�r�r�r�r�r�r�rQr�r�r�r�rr�r�r��	Exception�printrrMrI�	traceback�	print_exc�flush)r�errorr"Zcollect_funcrer	r	r
�collect_info�sT�$
�rcCsjd}t|�tdt|��t�|��}t|���}|D]$\}}|�dd�}td||f�q:t�dS)NzPython debug information�=�
rz%s: %s)r�lenrrkr�replace)rr�titleZinfosrrr	r	r
�	dump_infosrcCs6t�}t|�}t|�|r2tdtjd�t�d�dS)Nz"Collection failed: exit with errorrr^)rrrrrMrI�exit)rr
r	r	r
�mainsr�__main__)N)-r�Z
__future__rrcrrMrr�rrr'r+r.rQrVrYr\rfr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr	r	r	r
�<module>sX9~	#5





#	5




Zerion Mini Shell 1.0