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

�
�^��@snddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZGdd�de�Z
dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zejd�Zedej�dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"d*d+�Z#d,d-�Z$d.d/�Z%d0d1�Z&d2d3�Z'd4d5�Z(d6d7�Z)Gd8d9�d9ej*�Z+d:d;�Z,e-d<k�rjej.�dS)=�N)�support)�
_FakeInputc@s$eZdZdd�Zdd�Zdd�ZdS)�PdbTestInputcCs
||_dS)N)�input)�selfr�r�-/opt/alt/python36/lib64/python3.6/test_pdb.py�__init__szPdbTestInput.__init__cCs0tj|_t|j�t_ttd�r&tj�nd|_dS)N�gettrace)�sys�stdin�
real_stdinrr�hasattrr
�
orig_trace)rrrr�	__enter__szPdbTestInput.__enter__cGs|jt_|jrtj|j�dS)N)r
rrr�settrace)r�excrrr�__exit__szPdbTestInput.__exit__N)�__name__�
__module__�__qualname__r	rrrrrrrsrcCsdS)Nrrrrr�test_pdb_displayhook"srcCsdS)Nrrrrr�test_pdb_basic_commands?srcCsdS)Nrrrrr�test_pdb_breakpoint_commands�srcCsdS)Nrrrrr�
do_nothingsrcCstd�dS)N�*)�printrrrr�do_somethingsrcCsdS)Nrrrrr�test_list_commands!srcCsdS)Nrrrrr�test_post_mortem�srcCsdS)Nrrrrr�test_pdb_skip_modules�sr Zmodule_to_skipz6def foo_pony(callback): x = 1; callback(); return NonecCsdS)Nrrrrr�#test_pdb_skip_modules_with_callback�sr!cCsdS)Nrrrrr� test_pdb_continue_in_bottomframesr"cCsttjddd�|�|�dS)NTF)ZnosigintZreadrc)�getattr�pdbZPdb)�method�argrrr�
pdb_invoke0sr'cCsdS)Nrrrrr�$test_pdb_run_with_incorrect_argument5sr(cCsdS)Nrrrrr�test_pdb_run_with_code_objectEsr)cCsdS)Nrrrrr�&test_next_until_return_at_return_event[sr*cCsdS)Nrrrrr�#test_pdb_next_command_for_generator�sr+cCsdS)Nrrrrr�#test_pdb_next_command_for_coroutine�sr,cCsdS)Nrrrrr�"test_pdb_next_command_for_asyncgensr-cCsdS)Nrrrrr�%test_pdb_return_command_for_generatorJsr.cCsdS)Nrrrrr�%test_pdb_return_command_for_coroutine�sr/cCsdS)Nrrrrr�$test_pdb_until_command_for_generator�sr0cCsdS)Nrrrrr�$test_pdb_until_command_for_coroutine�sr1cCsdS)Nrrrrr�+test_pdb_next_command_in_generator_for_loopsr2cCsdS)Nrrrrr�!test_pdb_next_command_subiterator-sr3cCsdS)Nrrrrr�test_pdb_issue_20766\sr4c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�PdbTestCasec	Cs�d}t|d��}|jtj|��WdQRX|jtj|�|jtjd�tj	dd|g}d}}t
j|t
jt
jt
j
d��}|jtj|��\}}WdQRX|o�tj|�}|o�tj|�}||fS)Nzmain.py�w�__pycache__z-mr$)�stdoutr�stderr)�open�write�textwrap�dedent�
addCleanupr�unlinkZrmtreer�
executable�
subprocess�Popen�PIPE�STDOUT�communicate�str�encode�bytes�decode)	r�script�commands�filename�f�cmdr8r9�procrrr�run_pdbvs

zPdbTestCase.run_pdbcCsbtj|�}ttjd��}|j|�WdQRX|s4dn|dtj|df}|j|tj|tj��dS)Nr6r�)	r<r=r:r�TESTFNr;ZassertEqualr$Z
find_function)rZfile_contentZ	func_name�expectedrMrrr�_assert_find_function�s
z!PdbTestCase._assert_find_functioncCs|jddd�dS)N�Zfoo)rT)rrrr�test_find_function_empty_file�sz)PdbTestCase.test_find_function_empty_filecCs|jddd�dS)Nz�            def foo():
                pass

            def bar():
                pass

            def quux():
                pass
            �bar�)rWrX)rT)rrrr�test_find_function_found�s
z$PdbTestCase.test_find_function_foundc
Csxttjd��}|jd�WdQRXtjddtjg}tj|tjtjtj	d�}|j
|jj�|j
d�\}}|jd|d�dS)	N�wbsprint("testing my pdb")
z-mr$)r8rr9squit
sSyntaxErrorz0Got a syntax error running test script under PDB)r:rrRr;rr@rArBrCrDr>r8�closerE�assertNotIn)rrMrNrOr8r9rrr�test_issue7964�s
zPdbTestCase.test_issue7964cCsrd}d}d}tdd��}|jtj|��WdQRX|jtjd�|j||�\}}|jt	dd�|j
�D��d�dS)	Nz�
            from bar import bar

            def foo():
                bar()

            def nope():
                pass

            def foobar():
                foo()
                nope()

            foobar()
        z�
            from bar import bar
            break bar
            continue
            step
            step
            quit
        z5
            def bar():
                pass
        zbar.pyr6css|]}d|kVqdS)zmain.py(5)foo()->NoneNr)�.0�lrrr�	<genexpr>�sz.PdbTestCase.test_issue13183.<locals>.<genexpr>z+Fail to step into the caller after a return)r:r;r<r=r>rr?rPZ
assertTrue�any�
splitlines)rrJrKrWrMr8r9rrr�test_issue13183�szPdbTestCase.test_issue13183c
Cs�tjd�ttjd��}|jtjd�jd��WdQRXtj	dtjg}t
j|t
jt
jt
j
d�}|j|jj�|jd�\}}|jd|j�d	�dS)
NZ	threadingrZa
                import threading
                import pdb

                def start_pdb():
                    pdb.Pdb(readrc=False).set_trace()
                    x = 1
                    y = 1

                t = threading.Thread(target=start_pdb)
                t.start()�asciiz-u)r8rr9scont
�Errorz*Got an error running test script under PDB)r�
import_moduler:rRr;r<r=rGrr@rArBrCrDr>r8r[rEr\rI)rrMrNrOr8r9rrr�test_issue13210�s


zPdbTestCase.test_issue13210cCs6d}d}d}|j||�\}}|j||dj||��dS)Nzdef f: pass
rUzSyntaxError:zE

Expected:
{}
Got:
{}
Fail to handle a syntax error in the debuggee.)rPZassertIn�format)rrJrKrSr8r9rrr�test_issue16180�szPdbTestCase.test_issue16180c&Cs�tjd�}tjjdd�}z�tj���tdd��}|jd�WdQRXtdd��}|j|�WdQRXt	j
dg}tj|tj
tj
tj
d�}|�$|jd�\}}|jd	|j��WdQRXWdQRXWd|dk	r�|tjd<XdS)
Nz_
            import pdb; pdb.Pdb(readrc=False).set_trace()

            print('hello')
        �HOMEz.pdbrcr6zinvalid
zmain.py)r8rr9sq
z(NameError: name 'invalid' is not defined)r<r=�os�environ�poprZtemp_cwdr:r;rr@rArBrCrEr\rI)rrJZ	save_homerMrNrOr8r9rrr�test_readrc_kwargs*


"zPdbTestCase.test_readrc_kwargcCstjtj�dS)N)rr?rR)rrrr�tearDown#szPdbTestCase.tearDownN)
rrrrPrTrVrYr]rcrgrirnrorrrrr5ts$ r5cGs*ddlm}tjt�tj|�g}tj|�S)Nr)�test_pdb)�testrp�unittestZ	makeSuiter5�doctestZDocTestSuiteZ	TestSuite)�argsrpZsuitesrrr�
load_tests'sru�__main__)/rsrkr$r�typesrrrAr<rqrZtest.test_doctestr�objectrrrrrrrrr �
ModuleType�mod�exec�__dict__r!r"r'r(r)r*r+r,r-r.r/r0r1r2r3r4ZTestCaser5rur�mainrrrr�<module>sRnn`>
+*A;7<7),.)/4


Youez - 2016 - github.com/yon3zu
LinuXploit