403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/__pycache__/test_imp.cpython-36.opt-1.pyc
3

�w2_4@�@syddlZWnek
r$dZYnXddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
e
j��e
jde
�ddlZWdQRXdd�Ze	jedkd�Gdd�de	j��ZGd	d
�d
e	j�ZGdd�de	j�ZGd
d�de	j�ZGdd�de	j�Zedk�re	j�dS)�N)�support�ignorecCs"tj|�}tjttd�d�|�S)zXDecorator to skip a test if not running under CPython or lacking
    imp.load_dynamic().�load_dynamiczimp.load_dynamic() required)r�cpython_only�unittest�skipIf�hasattr�imp)�meth�r�2/opt/alt/python36/lib64/python3.6/test/test_imp.py�requires_load_dynamics
r
z_thread module is requiredc@s eZdZdZdd�Zdd�ZdS)�	LockTestsz)Very basic test of import lock functions.cCs|jtj�|d|�dS)Nz!expected imp.lock_held() to be %r)�assertEqualr	�	lock_held)�selfZexpectedrrr�verify_lock_stateszLockTests.verify_lock_statecCs�d}tj�}|j|�x"t|�D]}tj�|jd�q Wxt|�D]}tj�qDW|j|�|s�ytj�Wntk
r�YnX|jd�dS)N�2Tz5release_lock() without lock should raise RuntimeError)r	rr�range�acquire_lock�release_lock�RuntimeErrorZfail)rZLOOPSZlock_held_at_start�irrr�testLock"s

zLockTests.testLockN)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zedd��Z
edd��Zedd��Zedd��Zejejd�dd��Zdd�Zd d!�Zejd"d#��Zd$S)%�ImportTestscCstjd�}|j|_|j|_dS)Nztest.encoded_modules)�	importlib�
import_module�test_strings�__path__�	test_path)r�modrrr�setUp>s
zImportTests.setUpcCs6x0|jD]&\}}}tjd|�}|j||j�qWdS)Nztest.encoded_modules.module_)r!rr r�test)r�modname�encodingZteststrr$rrr�test_import_encoded_moduleCsz&ImportTests.test_import_encoded_modulecCszxD|jD]:\}}}tjd||j�d�}|j|j|�WdQRXqWtjjt	�g}|j
t��tjd|�WdQRXdS)N�module_r�badsyntax_pep3120)r!r	�find_moduler#rr(�os�path�dirname�__file__�assertRaises�SyntaxError)rr$r(�_�fdr.rrr�test_find_module_encodingIsz%ImportTests.test_find_module_encodingcCs�xz|jD]p\}}}tjd||j�\}}}|�D|j|d�|j|j|�|j|j�d�|j|j�d|�WdQRXqWtjd�\}}}|�@|j|d�|j|jd�|j|j�d�|j|j�d�WdQRXdS)Nr*rz# test %s encoding
�tokenizezutf-8z*"""Tokenization help for Python programs.
)	r!r	r,r#ZassertNotEqualrr(�tell�readline)rr$r(r3�fp�filename�inforrr�test_issue1267Rs 

zImportTests.test_issue1267cCs�d}tjjdd�zNt|dd��}|jd�WdQRXtj|�\}}}|j�|j|j	d�Wdtjd=t
j|d�t
j|d�XdS)	NZtest_imp_helperr�.z.py�wz%# coding: cp1252
u = 'test.test_imp'
�cp1252z.pyc)�sysr.�insert�open�writer	r,�closerr(r�unlink)r�
temp_mod_name�filer:r;rrr�test_issue3594eszImportTests.test_issue3594c5Cs�tj�}ddddddddddd�
}tjdkr>|j|d�d	}n
|j|�}|sZ|jd
|�|j|�}d|}d|}tjj	|d
�}�z�tjj
dtj�t|dd��}|j
d�WdQRXtj|�\}}	}
|�x|j|�|j|	dd�j|��|j|
dd�|j|
dd�|j|
dtj�tj|||	|
�}|j|jd�WdQRXtj�� tjd�tj||d�}WdQRX|j|jd�tj��.tjd�tj�s�tj|tj|d��}WdQRX|j|jd�tjj|��s�tj|�t|d��}|j
d�WdQRXtj��tjd�tj||�}WdQRX|j|j d�Wdtjd=x*dD]"}
t!j"||
�t!j"||
��qTWt!j#|�t!j#d�XdS)Ns�������)
zutf-8�cp1250�cp1251r?�cp1253�cp1254�cp1255�cp1256�cp1257�cp1258�darwinzutf-8säz2can't run this test with %s as filesystem encodingZtest_imp_helper_Ztest_imp_helper_package_z__init__.pyr�.pyr>za = 1
���r�rzb = 2
�.pyc�__pycache__���)rVr[)$r@�getfilesystemencoding�platformr�get�skipTest�decoder-r.�joinrA�curdirrBrCr	r,ZassertIsNotNoneZ
assertTrue�endswithZ	PY_SOURCE�load_module�a�warnings�catch_warnings�simplefilter�load_source�dont_write_bytecodeZ
load_compiled�cache_from_source�exists�mkdirZload_package�brrEZrmtree)rZfs_encodingZ
known_localesZspecial_charZdecoded_charrFZtest_package_nameZinit_file_namerGr:r;r$�packageZextrrr�test_issue5604ssx












zImportTests.test_issue5604cCs$tjjt�}|jttjd|g�dS)Nr+)r-r.r/r0r1r2r	r,)rr.rrr�test_issue9319�szImportTests.test_issue9319c
Csttj}tj}tj��Vtjd�}|j|dj�tj	d|��}|j
t|�|j
||j�|j||j�WdQRXdS)Nr-r)r-)r-r.�getenvr�EnvironmentVarGuardr	r,�
addCleanuprDrf�assertIsZassertIsNot)rZ	orig_pathZorig_getenv�xZnew_osrrr�test_load_from_source�s	

z!ImportTests.test_load_from_sourcecCsLd}tj|�}|d}|dk	r*|j|j�tj|f|��}|j|j|�dS)N�_heapqr)r	r,rvrDrfrr)rZexamplerxZfile_r$rrr�test_issue15828_load_extensions�s
z+ImportTests.test_issue15828_load_extensionsc
Cs�d}tj|�\}}}|j�tj||�}tjd|�}tjd|�}|j|j|�|j|jd�|j|jd�|jt��tjd|�WdQRXdS)N�_testimportmultipleZ_testimportmultiple_fooZ_testimportmultiple_barZnonexistent)r	r,rDrrrr1�ImportError)r�mZfileobj�pathnameZdescriptionZmod0Zmod1Zmod2rrr�+test_issue16421_multiple_modules_in_one_dll�sz7ImportTests.test_issue16421_multiple_modules_in_one_dllc
CsNd}d}|jt��}tj||�WdQRX|j||jj�|j||jj�dS)Nzbogus file path�	extension)	r1r}r	rZassertInZ	exceptionr.r�name)rr.r��errrrr�"test_load_dynamic_ImportError_path�sz.ImportTests.test_load_dynamic_ImportError_pathcCs`d}tj|�}|ddk	r&|dj�|ddtjkrB|jd�tj|df|dd���dS)Nr|rrZz/found module doesn't appear to be a C extensionrX)r	r,rDZC_EXTENSIONrarf)rr��foundrrr�'test_load_module_extension_file_is_None	s

z3ImportTests.test_load_module_extension_file_is_NonecCs�d}ytj|=Wntk
r$YnXz�tj|�}tjjd�}tj||j	�}|j
|j|�|j
|jj
|�|j
|jj	|j	�|jtt|d�|j
|jd�|jtj||�Wdytj|=Wntk
r�YnXXdS)Nztest.imp_dummyZ_testmultiphaseZ
dummy_namei�)r@�modules�KeyErrorrr �util�	find_specr	r�originrr�__spec__r�r1�AttributeError�getattrZ	int_constrw)rr��module�specrrr�3test_issue24748_load_module_skips_sys_modules_checks&
z?ImportTests.test_issue24748_load_module_skips_sys_modules_checkz*test meaningful only when writing bytecodec
CsDtj��2tjd}tj|�|jtdtjtjdg�WdQRXdS)Nz.pyz
^No moduler=)	rZtemp_cwdZTESTFNr-ro�assertRaisesRegexr}r	r,)r�sourcerrr�test_bug7732-s



zImportTests.test_bug7732cCs2tjdtjttj��}|jtj�|jtj�dS)Nr	)r	Z_LoadSourceCompatibilityr0rB�get_data)r�loaderrrr�test_multiple_calls_to_get_data6s
z+ImportTests.test_multiple_calls_to_get_datacCsddt��}ttjt�|�}tjtj||��.|jtd��tj	|t
d�WdQRXWdQRXdS)NZtmpz
embedded null�)r�typer@r�rZ	swap_itemr��
ValueErrorr	rkr0)rr'r$rrr�test_load_source=s

zImportTests.test_load_sourcec	Cs>tjtd�}Gdd�d�}|jt��||��WdQRXdS)N�create_dynamicc@seZdZdZdZdS)z,ImportTests.test_issue31315.<locals>.BadSpecN�foo)rrrr�r�rrrr�BadSpecKsr�)rZ
get_attributer	r1�	TypeError)rr�r�rrr�test_issue31315FszImportTests.test_issue31315N)rrrr%r)r5r<rHrrrsryr
r{r�r�r�r�rrr@rlr�r�r�rrr�rrrrr=s$	W
	rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ReloadTestszPVery basic tests to make sure that imp.reload() operates just like
    reload().c	Cs*tj��ddl}tj|�WdQRXdS)Nr)rrur-r	�reload)rr-rrr�test_sourceWs
zReloadTests.test_sourcec	Cs,tjd��ddl}tj|�WdQRXdS)N�timer)r�CleanImportr�r	r�)rr�rrr�test_extensioncszReloadTests.test_extensionc	Cs,tjd��ddl}tj|�WdQRXdS)N�marshalr)rr�r�r	r�)rr�rrr�test_builtinhszReloadTests.test_builtinc	sTddlm}tjjd���fdd�}|j|�|jtd��tj	|�WdQRXdS)Nr)�parser�htmlcs�tjd<dS)Nr�)r@r�r)r�rr�cleanupqsz5ReloadTests.test_with_deleted_parent.<locals>.cleanup)
r�r�r@r��poprvr�r}r	r�)rr�r�r)r�r�test_with_deleted_parentms
z$ReloadTests.test_with_deleted_parentN)rrrrr�r�r�r�rrrrr�Rs
r�c@sPeZdZdZej�Zeje	j
jdk	d�dd��Zeje	j
jdk	d�dd��Z
dS)	�PEP3147TestszTests of PEP 3147.Nz1requires sys.implementation.cache_tag not be NonecCsFtjjdddd�}tjjdddddj|j��}|jtj|d�|�dS)Nr��bar�bazzqux.pyr\z
qux.{}.pycT)r-r.rc�format�tagrr	rm)rr.�expectrrr�test_cache_from_source}sz#PEP3147Tests.test_cache_from_sourcez4requires sys.implementation.cache_tag to not be NonecCsDtjjdddddj|j��}tjjdddd�}|jtj|�|�dS)Nr�r�r�r\z
qux.{}.pyczqux.py)r-r.rcr�r�rr	�source_from_cache)rr.r�rrr�test_source_from_cache�sz#PEP3147Tests.test_source_from_cache)rrrrr	Zget_tagr�rZ
skipUnlessr@�implementation�	cache_tagr�r�rrrrr�xs	r�c@s&eZdZejejdkd�dd��ZdS)�NullImporterTestsNzNeed an undecodeable filenamecCs6tj}tj|�z|jttj|�Wdtj|�XdS)N)	r�TESTFN_UNENCODABLEr-ror1r}r	ZNullImporter�rmdir)rr�rrr�test_unencodeable�s

z#NullImporterTests.test_unencodeable)rrrrrrr�r�rrrrr��sr��__main__)�_threadr}r�importlib.utilr-Zos.pathr@r&rrrhrirj�DeprecationWarningr	r
rZTestCaserrr�r�r�r�mainrrrr�<module>s2


"&


Youez - 2016 - github.com/yon3zu
LinuXploit