403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.217.130
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_code.cpython-36.opt-2.pyc
3

�
�^�)�@s�ddlZddlZddlZddlZddlZyddlZWnek
rLdZYnXddlmZm	Z	m
Z
mZdd�Zdd�Z
dd�ZGd	d
�d
ej�Zdd�ZGd
d�dej�ZGdd�dej�Zedd�o�edk	�rnejZejdej�ZejZefe_eje_ejZej ejejfe_ej!e_ej"Z#ej ejej$ej�fe#_ej!e#_da%dd�Z&ee&�Z'ee'�Z(Gdd�dej�Z)ddd�Z*e+dk�r�e*�dS)�N)�run_doctest�run_unittest�cpython_only�check_impl_detailccs8x2|D]*}t|�}|jd�r*d|jVq|VqWdS)Nz<code objectz<code object %s>)�repr�
startswith�co_name)�tZelt�r�r�./opt/alt/python36/lib64/python3.6/test_code.py�constsvs


r
c	Cs@x&d
D]}td
|t|d|�f�qWtdtt|j���dS)N�name�argcount�kwonlyargcount�names�varnames�cellvars�freevars�nlocals�flagsz%s: %sZco_zconsts:)	rrrrrrrrr)�print�getattr�tupler
�	co_consts)�co�attrrrr�dumpsrcCsdt�j|���S)NzForeign getitem: )�super�__getitem__)�self�irrr�external_getitem�sr"c@s$eZdZedd��Zedd��ZdS)�CodeTestcCsDddl}|jddd�}|j|jd�|j|jd�|j|jd�dS)Nr�filename�funcname�)�	_testcapiZ
code_newempty�assertEqual�co_filenamer�co_firstlineno)r r'rrrr�
test_newempty�s
zCodeTest.test_newemptycs�ddlm�m�dd���fdd�����fdd�}Gd	d
�d
t�}||dt�|j}|jdj}|j||�|j	|j
jtj
@t|j
j��|dd
dg�}|j|dd�dS)Nr)�FunctionType�CodeTypecs�fdd�jS)Ncs�S)Nrr)�	__class__rr�<lambda>�szICodeTest.test_closure_injection.<locals>.create_closure.<locals>.<lambda>)�__closure__)r.r)r.r�create_closure�sz7CodeTest.test_closure_injection.<locals>.create_closurecsF�|j|j|j|j|j|j|j|j|j|j	|j
|j|j|j
d|j�S)Nr.)r.)�co_argcount�co_kwonlyargcount�
co_nlocals�co_stacksize�co_flags�co_coder�co_names�co_varnamesr)rr*�	co_lnotab�co_freevars�co_cellvars)�c)r-rr�new_code�s
z1CodeTest.test_closure_injection.<locals>.new_codec	s6�|j�}�|�}|j}t||�|t�|||��dS)N)�__code__�__defaults__�setattr�globals)�clsr�f�codeZclosure�defaults)r,r1r>rr�add_foreign_method�s
z;CodeTest.test_closure_injection.<locals>.add_foreign_methodc@seZdZdS)z-CodeTest.test_closure_injection.<locals>.ListN)�__name__�
__module__�__qualname__rrrr�List�srKr���zForeign getitem: 1)�typesr,r-�listr"rr0�
cell_contentsZassertIs�assertFalser?r6�inspectZ	CO_NOFREE�hexr()r rGrKZfunctionZ	class_ref�objr)r-r,r1r>r�test_closure_injection�szCodeTest.test_closure_injectionN)rHrIrJrr+rVrrrrr#�sr#cCs|tjd|ddd��kS)N�_rL���)�sys�intern)�srrr�
isinterned�sr\c@s`eZdZdd�Zdd�Zdd�Zedd��Zed	d
��Zedd��Z	ed
d��Z
edd��ZdS)�CodeConstsTestcCs4x|D]}||kr|SqW|j||�|jd�dS)NzShould never be reached)ZassertIn�fail)r r
�value�vrrr�
find_const�s

zCodeConstsTest.find_constcCst|�s|jd|f�dS)NzString %r is not interned)r\r^)r r[rrr�assertIsInterned�szCodeConstsTest.assertIsInternedcCst|�r|jd|f�dS)NzString %r is interned)r\r^)r r[rrr�assertIsNotInterned�sz"CodeConstsTest.assertIsNotInternedcCs(tddd�}|j|jd�}|j|�dS)Nzres = "str_value"�?�exec�	str_value)�compilerarrb)r rr`rrr�test_interned_string�sz#CodeConstsTest.test_interned_stringcCs,tddd�}|j|jd�}|j|d�dS)Nzres = ("str_value",)rdrerfr)rf)rgrarrb)r rr`rrr�test_interned_string_in_tuple�sz,CodeConstsTest.test_interned_string_in_tuplecCs4tddd�}|j|jtd��}|jt|�d�dS)Nzres = a in {"str_value"}rdrerfr)rf)rgrar�	frozensetrbr)r rr`rrr�!test_interned_string_in_frozenset�sz0CodeConstsTest.test_interned_string_in_frozensetcCsddd�}|j|��dS)NrfcSs|S)Nr)�arrrrD�sz6CodeConstsTest.test_interned_string_default.<locals>.f)rf)rb)r rDrrr�test_interned_string_default�s
z+CodeConstsTest.test_interned_string_defaultcCs(tddd�}|j|jd�}|j|�dS)Nzres = "str\0value!"rdrez
strvalue!)rgrarrc)r rr`rrr�test_interned_string_with_null�sz-CodeConstsTest.test_interned_string_with_nullN)rHrIrJrarbrcrrhrirkrmrnrrrrr]�sr]c@seZdZdd�ZdS)�CodeWeakRefTestcsni}tdt�|�|d}~d�_�fdd�}tj|j|�}�jt|���~�jt|����j�j�dS)Nz
def f(): passrDFcs
d�_dS)NT)�called)rE)r rr�callback�sz,CodeWeakRefTest.test_basic.<locals>.callback)	rerBrp�weakref�refr?Z
assertTrue�boolrR)r �	namespacerDrqZcoderefr)r r�
test_basic�szCodeWeakRefTest.test_basicN)rHrIrJrvrrrrro�sroT)�cpythoncCs|adS)N)�
LAST_FREED)Zptrrrr�myfreesryc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�CoExtracCstd�S)Nz	lambda:42)�eval)r rrr�get_func$szCoExtra.get_funccCs<|j�}|jttdttjd��|jttdttjd��dS)N�*�d)r|�assertRaises�SystemError�SetExtra�
FREE_INDEX�ctypes�c_voidp�GetExtra)r rDrrr�test_get_non_code*s
zCoExtra.test_get_non_codecCsJ|j�}|jtt|jtdtjd��|jt	|jtdtjd��d�dS)Nr~r)
r|rr�r�r?r�r�r�r(r�)r rDrrr�test_bad_index2s
zCoExtra.test_bad_indexcCs.|j�}t|jttjd��~|jtd�dS)Nr~)r|r�r?r�r�r�r(rx)r rDrrr�test_free_called9szCoExtra.test_free_calledcCsn|j�}tj�}t|jttjd��t|jttjd��|jtd�tj�}t|jt|�|j|j	d�~dS)N��i,)
r|r�r�r�r?r�r(rxr�r_)r rDZextrarrr�test_get_setBszCoExtra.test_get_setcCsZ|j�}Gdd�dtj�}t|jttjd��|||�}~|j�|j	�|j
td�dS)Ncs$eZdZ�fdd�Zdd�Z�ZS)z6CoExtra.test_free_different_thread.<locals>.ThreadTestcst�j�||_||_dS)N)r�__init__rD�test)r rDr�)r.rrr�Ws
z?CoExtra.test_free_different_thread.<locals>.ThreadTest.__init__cSs|`|jjtd�dS)Ni�)rDr�r(rx)r rrr�run[sz:CoExtra.test_free_different_thread.<locals>.ThreadTest.run)rHrIrJr�r��
__classcell__rr)r.r�
ThreadTestVsr�i�)r|�	threadingZThreadr�r?r�r�r��start�joinr(rx)r rDr��ttrrr�test_free_different_threadRs	
z"CoExtra.test_free_different_threadN)	rHrIrJr|r�r�r�r�r�rrrrrz#s	rzcCsHddlm}t||�tttg}tdd�r<tdk	r<|jt	�t
|�dS)Nr)�	test_codeT)rw)r�r�rr#r]rorr��appendrzr)�verboser�Ztestsrrr�	test_mainfs


r��__main__)N),rSrYr�Zunittestrrr��ImportErrorZtest.supportrrrrr
rr"ZTestCaser#r\r]roZ	pythonapi�pyZ	CFUNCTYPEr�ZfreefuncZ_PyEval_RequestCodeExtraIndexZRequestCodeExtraIndexZargtypesZ	c_ssize_tZrestypeZ_PyCode_SetExtrar�Z	py_objectZc_intZ_PyCode_GetExtrar�ZPOINTERrxryZ	FREE_FUNCr�rzr�rHrrrr�<module>isJ
		30C



Youez - 2016 - github.com/yon3zu
LinuXploit