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.10/test/test_importlib/__pycache__/test_pkg_import.cpython-310.pyc
o

�i�
�@szddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
Gdd�dej�Ze
dkr;e��dSdS)�N)�cache_from_source)�create_empty_filec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
TestImportcOs^d|_|jtjvr|jt�tj�7_|jtjvs	|jd|_tj	j
|g|�Ri|��dS)NZPACKAGE_z.foo)�package_name�sys�modules�random�choice�string�
ascii_letters�module_name�unittest�TestCase�__init__)�self�args�kw�r�@/usr/local/lib/python3.10/test/test_importlib/test_pkg_import.pyrs�zTestImport.__init__cCs(|j|jfD]}|tjvrtj|=qdS)N)rrrr)rrrrr�remove_moduless

��zTestImport.remove_modulescCsbt��|_tj�|j�tj�|j|j�|_	t�
|j	�ttj�|j	d��tj�|j	d�|_dS)Nz__init__.pyzfoo.py)
�tempfile�mkdtemp�test_dirr�path�append�os�joinrZpackage_dir�mkdirr�module_path�rrrr�setUps

�zTestImport.setUpcCs<t�|j�|�tj�|j�d�tj�|j�|��dS)Nr)	�shutil�rmtreerZassertNotEqualrr�count�removerrrrr�tearDown#szTestImport.tearDowncCs`t|j�}tj�|�rt�|�t|jddd��}|�|�Wd�dS1s)wYdS)N�wzutf-8)�encoding)rrrr�existsr$�open�write)r�contentsZ
compiled_path�frrr�rewrite_file)s

"�zTestImport.rewrite_filecCs�|�d�z
t|j�Wtd��tyYnw|�|jtj�|�t	tj|j
d��d}|tt�vrC|t
�tj�7}|tt�vs5|�|�z
t|j�Wtd��ty[Ynw|�d|�t|j�j}|�t||�d�dS)N�forzFailed to induce SyntaxError�foo�azFailed to induce NameError.z%s = 1�)r-�
__import__r�SyntaxError�RuntimeErrorZassertNotInrrZassertFalse�hasattrr�dir�__builtins__rr	r
r�	NameErrorr/ZassertEqual�getattr)r�var�modulerrr�test_package_import__semantics0s"
��
�z)TestImport.test_package_import__semanticsN)	�__name__�
__module__�__qualname__rrr r%r-r<rrrrrs	r�__main__)rrr!r
rrr
�importlib.utilrZtest.support.os_helperrrrr=�mainrrrr�<module>sC�