HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/test_importlib/__pycache__/test_windows.cpython-37.pyc
B

��gW�@s$ddlmZe�d�ZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddlmZe
jd	d
gd�ddlmZmZmZmZmZmZmZmZmZd
d�Zeddd��Ze�ej�d
�d�Gdd�d��Z ej!e ed�\Z"Z#e�ej�d
�d�Gdd�d��Z$ej!e$ed�\Z%Z&dS)�)�utilzimportlib.machinery�N)�support)�get_platform)�contextmanager)�temp_module�winreg�win)Zrequired_on)	�	CreateKey�HKEY_CURRENT_USER�SetValue�REG_SZ�KEY_ALL_ACCESS�EnumKey�CloseKey�	DeleteKey�OpenKeycCstyt||td�}Wntk
r&dSXx4yt|d�}Wntk
rNPYnXt||�q*Wt|�t||�dS)N)�accessr)rr�OSErrorr�delete_registry_treerr)�root�subkey�hkeyZ	subsubkey�r�</usr/local/lib/python3.7/test/test_importlib/test_windows.pyrsrc	cs�|jjr|jj}n|jj}|j|dtjdd�d�}zHt|d��4}tt	|�}|dkr^|d}t
|dt|�dVWdQRXWd|jjr�tj
�|�}tt	|�XdS)Nz%d.%d�)�fullname�sys_versionza = 1z.py�)�WindowsRegistryFinder�DEBUG_BUILD�REGISTRY_KEY_DEBUG�REGISTRY_KEY�format�sys�version_inforr
rrr
�os�path�dirnamer)�	machinery�namer'r�key�locationrrrr�setup_module$s

r-zrequires Windowsc@s:eZdZd�e���Zdd�Zdd�Zdd�Z	dd	�Z
d
S)�WindowsRegistryFinderTestsz	spamham{}cCs|jj�d�}|�|d�dS)N�spam)r)r�	find_spec�assertIs)�self�specrrr�test_find_spec_missing?sz1WindowsRegistryFinderTests.test_find_spec_missingcCs|jj�d�}|�|d�dS)Nr/)r)r�find_moduler1)r2�loaderrrr�test_find_module_missingCsz3WindowsRegistryFinderTests.test_find_module_missingc	CsVt|j|j��>|jj�|j�}|jj�|j�}|�|d�|�|d�WdQRXdS)N)r-r)�test_modulerr5r0ZassertIsNot)r2r6r3rrr�test_module_foundGs
z,WindowsRegistryFinderTests.test_module_foundc	CsVt|j|jdd��:|jj�|j�}|jj�|j�}|�|�|�|�WdQRXdS)N�.)r')r-r)r8rr5r0ZassertIsNone)r2r6r3rrr�test_module_not_foundNs

z0WindowsRegistryFinderTests.test_module_not_foundN)�__name__�
__module__�__qualname__r#r&�getpidr8r4r7r9r;rrrrr.9s
r.)r)c@seZdZdd�ZdS)�WindowsExtensionSuffixTestscCs~|jj}d�tjt�ddt���}y|�d�}Wn&t	k
rV|�d�}d|}YnX|�
||�|�|�}|�||�dS)Nz.cp{0.major}{0.minor}-{1}.pydz[^a-zA-Z0-9]�_z.pydz_d.pydZ_d)r)�EXTENSION_SUFFIXESr#r$r%�re�subr�index�
ValueErrorZassertInZ
assertLess)r2�suffixesZexpected_tagZ
untagged_iZtagged_irrr�test_tagged_suffix[s

z.WindowsExtensionSuffixTests.test_tagged_suffixN)r<r=r>rHrrrrr@Ysr@)N)'rrZ	test_utilZimport_importlibr)r&rCr$ZunittestZtestrZdistutils.utilr�
contextlibrr�
import_modulerr
rrr
rrrrrrr-Z
skipUnless�platform�
startswithr.Z	test_bothZ!Frozen_WindowsRegistryFinderTestsZ!Source_WindowsRegistryFinderTestsr@Z"Frozen_WindowsExtensionSuffixTestsZ"Source_WindowsExtensionSuffixTestsrrrr�<module>s$
,""