403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.145
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_pdb.cpython-313.opt-2.pyc
�

��i�&���SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJrJ
r
 SSKJr SSKJr SSKJrJr SSKJr SSKJrJr SSKJr \R8(+r"S	S
\5rSr Sr!S
r"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+Sr,Sr-Sr.Sr/\R`Rb(dSr2Sr3Sr4Sr5Sr6S r7S!r8S"r9S#r:S$r;S%r<S&r=S'r>\R~"S(5r@\A"S)\@R�5 S*rCS+rDS,rES-rFS.rGS/rHS0rI\(dS1rJS2rKS3rL\(dS4rMS5rN\(dS6rOS7rPS8rQS9rRS:rSS;rTS<rUS=rVS>rWS?rXS@rYSArZSBr[SCr\SDr]SEr^SFr_SGr`SHraSIrbSJrcSKrd\R�"5"SLSM\R�55rg"SNSO\R�5rh\R�"5"SPSQ\R�55riSRrj\kSS:Xa\R�"5 gg)T�N)�	ExitStack�redirect_stdout)�StringIO)�support)�force_not_colorized�	os_helper)�
import_module)�run_pty�	FakeInput)�patchc�&�\rSrSrSrSrSrSrg)�PdbTestInput�c��Xlg�N)�input)�selfrs  �"C:\Python313\\Lib\test\test_pdb.py�__init__�PdbTestInput.__init__s���
�c���[RUl[UR5[l[[S5(a"5UlgSUlg)N�gettrace)�sys�stdin�
real_stdinrr�hasattrr�
orig_trace�rs r�	__enter__�PdbTestInput.__enter__!s<���)�)����d�j�j�)��	�,3�C��,D�,D�#�,�,�.���$��rc��UR[lUR(a![R"UR5 ggr)rrrr�settrace)r�excs  r�__exit__�PdbTestInput.__exit__&s)���O�O��	��?�?��L�L����)�r)rrrN)�__name__�
__module__�__qualname__�__firstlineno__rr r%�__static_attributes__�rrrrs���O�
*rrc��grr,r,rr�test_pdb_displayhookr.,��rc��grr,r,rr�test_pdb_basic_commandsr1Hr/rc�@�SSKnURR5 g)Nr)�bdb�
Breakpoint�clearBreakpoints)r3s r�reset_Breakpointr6�s����N�N�#�#�%rc��grr,r,rr�test_pdb_breakpoint_commandsr8�r/rc��grr,r,rr�-test_pdb_breakpoint_on_annotated_function_defr:ir/rc��grr,r,rr�!test_pdb_breakpoint_with_filenamer<�r/rc��grr,r,rr�:test_pdb_breakpoints_preserved_across_interactive_sessionsr>�r/rc��grr,r,rr�test_pdb_pp_repr_excr@�r/rc��grr,r,rr�test_pdb_empty_linerBr/rc��grr,r,rr�
do_nothingrD2s��rc��[S5 g)N�*)�printr,rr�do_somethingrH5s	��	�"�Irc��grr,r,rr�test_list_commandsrJ8r/rc��grr,r,rr�test_pdb_whatis_commandrL�r/rc��grr,r,rr�test_pdb_display_commandrN�r/rc��grr,r,rr�test_pdb_alias_commandrPr/rc��grr,r,rr�test_pdb_where_commandrRLr/rc��grr,r,rr�test_pdb_interact_commandrT�r/rc��grr,r,rr�test_convenience_variablesrV�r/rc��grr,r,rr�test_post_mortem_chainedrXr/rc��grr,r,rr�!test_post_mortem_cause_no_contextrZkr/rc��grr,r,rr�%test_post_mortem_context_of_the_causer\�r/rc��grr,r,rr�test_post_mortem_from_noner^�r/rc��grr,r,rr�test_post_mortem_from_no_stackr`r/rc��grr,r,rr� test_post_mortem_single_no_stackrb7r/rc��grr,r,rr�test_post_mortem_complexrdLr/rc��grr,r,rr�test_post_mortemrf�r/rc��grr,r,rr�!test_pdb_return_to_different_filerh�r/rc��grr,r,rr�test_pdb_skip_modulesrj'r/rc��grr,r,rr�test_pdb_invalid_argrlAr/r�module_to_skipz6def foo_pony(callback): x = 1; callback(); return Nonec��grr,r,rr�#test_pdb_skip_modules_with_callbackrobr/rc��grr,r,rr� test_pdb_continue_in_bottomframerq�r/rc�N�[[R"SSS9U5"U5 g)NTF)�nosigint�readrc)�getattr�pdb�Pdb)�method�args  r�
pdb_invokerz�s���C�G�G�T�%�0�&�9�#�>rc��grr,r,rr�$test_pdb_run_with_incorrect_argumentr|�r/rc��grr,r,rr�test_pdb_run_with_code_objectr~�r/rc��grr,r,rr�&test_next_until_return_at_return_eventr��r/rc��grr,r,rr�#test_pdb_next_command_for_generatorr�*r/rc��grr,r,rr�#test_pdb_next_command_for_coroutiner�jr/rc��grr,r,rr�"test_pdb_next_command_for_asyncgenr��r/rc��grr,r,rr�%test_pdb_return_command_for_generatorr��r/rc��grr,r,rr�%test_pdb_return_command_for_coroutiner�#r/rc��grr,r,rr�$test_pdb_until_command_for_generatorr�Qr/rc��grr,r,rr�$test_pdb_until_command_for_coroutiner��r/rc��grr,r,rr�+test_pdb_next_command_in_generator_for_loopr��r/rc��grr,r,rr�!test_pdb_next_command_subiteratorr��r/rc��grr,r,rr�test_pdb_multiline_statementr�	r/rc��grr,r,rr�test_pdb_closurer�4	r/rc��grr,r,rr� test_pdb_show_attribute_and_itemr�s	r/rc��grr,r,rr�test_pdb_issue_20766r��	r/rc��grr,r,rr�test_pdb_issue_43318r��	r/rc��grr,r,rr�test_pdb_issue_gh_91742r��	r/rc��grr,r,rr�test_pdb_issue_gh_94215r�
r/rc��grr,r,rr�test_pdb_issue_gh_101673r�H
r/rc��grr,r,rr�test_pdb_issue_gh_103225r�d
r/rc��grr,r,rr�test_pdb_issue_gh_101517r�}
r/rc��grr,r,rr�test_pdb_issue_gh_108976r��
r/rc��grr,r,rr�test_pdb_issue_gh_127321r��
r/rc��grr,r,rr�test_pdb_issue_gh_136057r��
r/rc��grr,r,rr�test_pdb_issue_gh_80731r��
r/rc��grr,r,rr�test_pdb_ambiguous_statementsr��
r/rc��grr,r,rr�test_pdb_f_trace_linesr�r/rc��grr,r,rr�test_pdb_frame_refleakr�r/rc��grr,r,rr�test_pdb_function_breakr�Or/rc��grr,r,rr�test_pdb_issue_gh_65052r�xr/rc�*�\rSrSrSr\R"\RRS5SDSj5r
SESjrSrSr
S	rS
rSrSrS
rSrSrSrSrSrSrSrSrSrSr\S5r\S5rSr Sr!Sr"Sr#Sr$Sr%S r&S!r'S"r(S#r)S$r*S%r+S&r,S'r-S(r.S)r/S*r0S+r1S,r2S-r3S.r4S/r5S0r6S1r7S2r8S3r9S4r:S5r;S6r<S7r=S8r>S9r?\@R�S:5rBS;rCS<rDS=rES>rFS?rGS@rHSArISBrJSCrKg)F�PdbTestCasei�c�L�[R"[R5 gr�r�unlink�TESTFNrs r�tearDown�PdbTestCase.tearDown��������)�)�*rz'PYTHONSAFEPATH changes default sys.pathNc	���UR[RS5 [RSS/U-nUb[
RU-nO[
Rn[R"U[R[R[R0UESS0ES9nUR[RU55up�SSS5 [W[5(a[RU5OUn[W	[5(a[RU	5OU	n	UR!WR"USUSU	35 X�4$!,(df   N�=f)	N�__pycache__�-mrv�PYTHONIOENCODING�utf-8��stdoutr�stderr�envzUnexpected return code
stdout: z	
stderr: )�
addCleanupr�rmtreer�
executable�os�environ�
subprocess�Popen�PIPE�communicate�str�encode�
isinstance�bytes�decode�assertEqual�
returncode)
r�pdb_args�commands�expected_returncode�	extra_env�cmdr��procr�r�s
          r�_run_pdb�PdbTestCase._run_pdb�s��
	
���	�(�(�-�8��~�~�t�U�+�h�6��� ��*�*�y�(�C��*�*�C�
�
�
��!��� �o�o�!���:��:�0�'�:�
��!�-�-�c�j�j��.B�C�N�F�
�*4�F�E�)B�)B����f�%���)3�F�E�)B�)B����f�%�������O�O��.�v�h�j���I�	
�
�~��
�
�s�&'E�
E!c��Sn[US5n	U	R[R"U55 SSS5 UbZ[SS5n	U	R[R"U55 SSS5 UR	[
RS5 UR	[
RU5 Sn
U(a [RRSS5n
Uc/nURU/U-X#U5up�U
bU
[RS'X�4$!,(df   N�=f!,(df   N�=f!U
bU
[RS'ff=f)N�main.py�w�.pdbrc�HOME)�open�write�textwrap�dedentr�rr�r�r��popr�)
r�scriptr�r�r��script_args�pdbrc�remove_home�filename�f�homesaver�r�s
             r�run_pdb_script�PdbTestCase.run_pdb_script�s����
�(�C�
 �A�
�G�G�H�O�O�F�+�,�!����h��$���������.�/�%��O�O�I�,�,�h�7����	�(�(�(�3�����z�z�~�~�f�d�3�H�	.��"� ��!�]�]�H�:��+C�X�dm�n�N�F��#�%-��
�
�6�"��~��'!�
 ��%�$���#�%-��
�
�6�"�$�s#�&D�&D,�$D=�
D)�,
D:�=Ec�@�SUl[R"UR5 URS-nURS-n[R"UR5 [US5nSSS5 [US5nUR
[R"U55 SSS5 UR[RUR5 URSUR/U5$!,(df   N�=f!,(df   Ng=f)N�t_main�/__main__.py�/__init__.pyr�r�)�module_namerr�r��mkdirr�r�r�r�r�r�)rr�r��	main_file�	init_filer�s      r�run_pdb_module�PdbTestCase.run_pdb_module�s���#�������)�)�*��$�$�~�5�	��$�$�~�5�	�
����!�!�"�
�)�S�
!�Q��"�
�)�S�
!�Q�
�G�G�H�O�O�F�+�,�"����	�(�(�$�*:�*:�;��}�}�d�D�$4�$4�5�x�@�@�"�
!��
!�
!�s�2C>�&D�>
D�
Dc�<�[[RS5nURU5 SSS5 U(dSOUS[RUS4nUR	U[
R"U[R55 g!,(df   Nf=f)N�wbr�)r�rr�r�r�rv�
find_function)r�file_content�	func_name�expectedr�s     r�_assert_find_function�!PdbTestCase._assert_find_function�sx��
�)�"�"�D�
)�Q�
�G�G�L�!�*� (�4��Q�K��)�)�8�A�;�.8������c�'�'�	�9�3C�3C�D�	F�*�
)�s�B
�
Bc�P�UR5=(d UR5$r)�_proc_fd_dir�_dev_fd_dirrs r�_fd_dir_for_pipe_targets�$PdbTestCase._fd_dir_for_pipe_targetss��� � �"�8�d�&6�&6�&8�8rc�"�[RRS5(agSn[RRU5(aD[RR
[RRUS55(aU$g)N�sunosz
/proc/self/fd�0)r�platform�
startswithr��path�isdir�exists�join)r�proc_fds  rr
�PdbTestCase._proc_fd_dirs]���<�<�"�"�7�+�+��!��
�7�7�=�=��!�!�b�g�g�n�n�R�W�W�\�\�'�3�5O�&P�&P��N�rc���Sn[RRU5(a�[RR[RR	US55(am[
RRS5(aG[R"S5R[R"U5R:XagU$U$g![a gf=f)Nz/dev/fdr�freebsdz/dev)r�rrrrrrr�stat�st_dev�FileNotFoundError)r�dev_fds  rr�PdbTestCase._dev_fd_dirs�����
�7�7�=�=�� � �R�W�W�^�^�B�G�G�L�L���4M�%N�%N��|�|�&�&�y�1�1� ��w�w�v��-�-������1G�1G�G�#�H��M�6�M���)� �� �s�AC�
C$�#C$c�*�URSSS5 g)Nr�foo)rrs r�test_find_function_empty_file�)PdbTestCase.test_find_function_empty_files���"�"�3��t�4rc�F�URSR5SS5 g)Nu@def foo():
    pass

def bœr():
    pass

def quux():
    pass
�bœr)r%��rr�rs r�test_find_function_found�$PdbTestCase.test_find_function_found!s$���"�"�	
��F�H���
	
rc�H�URSRS5SS5 g)NuV# coding: iso-8859-15
def foo():
    pass

def bœr():
    pass

def quux():
    pass
ziso-8859-15r%)r%�r'rs r�-test_find_function_found_with_encoding_cookie�9PdbTestCase.test_find_function_found_with_encoding_cookie1s'���"�"�

��F�=����	
rc�h�UR[RSR5-SS5 g)Nudef bœr():
    pass
r%)r%�)r�codecs�BOM_UTF8r�rs r�!test_find_function_found_with_bom�-PdbTestCase.test_find_function_found_with_bomBs2���"�"��O�O���F�H�

�
��
	
rc�V�SnSnURX5up4URSU5 g)NzJ
            import __main__
            print(__main__.__spec__)
        �continue�None�r��assertIn�rr�r�r��_s     r�	test_spec�PdbTestCase.test_specLs0����
���'�'��9�	���
�
�f�f�%rc�x�UR5nUcURS5 [R"5up#SnUR	XB5 UR	XC5 [R
R
U[U55n[R
RU5(dURS5 Sn[R"X6RS55 [R"U5 [R
SnUR	[R
RSU5 [R"U5nUR n	UR"n
[%X�5 UR'U
SS5 UR'U
S	UR(5 UR+U
S
5 g)Nz7anonymous pipe targets require /proc/self/fd or /dev/fdc�R�[R"U5 g![a gf=fr)r��close�OSError)�fds r�
safe_close�APdbTestCase.test_script_target_anonymous_pipe.<locals>.safe_closeds$��
��������
��
�s��
&�&z,fd directory does not expose anonymous pipeszmarker = "via_pipe"
r�r�marker�via_pipe�__file__�__spec__)r�skipTestr��piper�rrr�rr�r�r?r�__setitem__rv�
_ScriptTarget�code�	namespace�execr�r��assertIsNone)r�fd_dir�read_fd�write_fdrB�	pipe_path�
script_source�original_path0�target�	code_textrMs           r�!test_script_target_anonymous_pipe�-PdbTestCase.test_script_target_anonymous_pipeXsE���.�.�0���>��M�M�S�T��G�G�I���	�	
���
�,����
�-��G�G�L�L���W��6�	��w�w�~�~�i�(�(��M�M�H�I�/�
�
����/�/��8�9�
��������!���������,�,�a��@��"�"�9�-���K�K�	��$�$�	��Y�"�����8�,�j�9�����:�.����@����)�J�/�0rc���[R"S5R5nURUSS5 URUSS5 URUSS5 URUSS	5 g)
Na�            def foo(): pass

            def bar():
                pass  # line 4

            def baz():
                # comment
                pass  # line 8

            def mul():
                # code on multiple lines
                code = compile(   # line 12
                    'def f()',
                    '<string>',
                    'exec',
                )
        r!)r!r�bar)r[��baz)r]��mul)r_�)r�r�r�r)rrLs  r�(test_find_function_first_executable_line�4PdbTestCase.test_find_function_first_executable_line�sk����� �
�"�V�X�#	
�&	
�"�"�4��
�;��"�"�4��
�;��"�"�4��
�;��"�"�4���<rc���[[RS5nURS5 SSS5 [R
SS[R/n[R"U[R[R[RS9nURURR5 URS5upEURSUS5 g!,(df   N�=f)	Nrsprint("testing my pdb")
r�rv)r�rr�squit
sSyntaxErrorz0Got a syntax error running test script under PDB)r�rr�r�rr�r�r�r�r�r�r?r��assertNotIn�rr�r�r�r�r�s      r�test_issue7964�PdbTestCase.test_issue7964�s���
�)�"�"�D�
)�Q�
�G�G�2�3�*��~�~�t�U�I�,<�,<�=�������?�?��/�/��?�?���
	
������)�)�*��)�)�)�4��������K�	M�*�
)�s�C$�$
C2c��SnSnURX5up4U=(d SU=(d S-nURSUS5 URSUS5 g)Nz�
            def do_testcmdwithnodocs(self, arg):
                pass

            import pdb
            pdb.Pdb.do_testcmdwithnodocs = do_testcmdwithnodocs
        zA
            continue
            help testcmdwithnodocs
        ��AttributeErrorzCCalling help on a command with no docs should be handled gracefullyz;*** No help for 'testcmdwithnodocs'; __doc__ string missingz<Calling help on a command with no docs should print an error)r�rdr8)rr�r�r�r��outputs      r�test_issue46434�PdbTestCase.test_issue46434�sc�������,�,�V�>����,�B�6�<�R�0�����)�6�^�	`��
�
�S�U[�T�	Vrc�l�SnSnSn[SS5nUR[R"U55 SSS5 UR	[
RS5 URX5upVUR[SUR555S5 g!,(df   Nr=f)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
        �bar.pyr�c3�,# �UH
nSU;v� M g7f)zmain.py(5)foo()->NoneNr,��.0�ls  r�	<genexpr>�.PdbTestCase.test_issue13183.<locals>.<genexpr>�s���J�6I��'�1�,�6I���z+Fail to step into the caller after a return)r�r�r�r�r�rr�r��
assertTrue�any�
splitlines)rr�r�r[r�r�r�s       r�test_issue13183�PdbTestCase.test_issue13183�s����������(�C�
 �A�
�G�G�H�O�O�C�(�)�!����	�(�(�(�3��,�,�V�>�������J�f�6G�6G�6I�J�J�9�	;�	!�
 �s�&B%�%
B3c	�X�[[RS5nUR[R
"S5R
S55 SSS5 [RS[R/n[R"U[R[R[R0[RESS0ES9nURURR 5 UR#S5upEUR%S	US
5 g!,(df   N�=f)Nra
                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()�ascii�-ur�r�r�scont
�Error�*Got an error running test script under PDB�r�rr�r�r�r�r�rr�r�r�r�r�r�r�r�r?r�rdres      r�test_issue13120�PdbTestCase.test_issue13120�s����)�"�"�D�
)�Q�
�G�G�H�O�O�
%�
�%�f�W�o�

/�*��~�~�t�Y�%5�%5�6�������?�?��/�/��?�?�;�2�:�:�;�1�7�;�	��	
������)�)�*��)�)�)�4�������6�E�	G�+*�
)���5D�
D)c	�X�[[RS5nUR[R
"S5R
S55 SSS5 [RS[R/n[R"U[R[R[R0[RESS0ES9nURURR 5 UR#S5upEUR%S	US
5 g!,(df   N�=f)Nra�
                import threading
                import pdb

                evt = threading.Event()

                def start_pdb():
                    evt.wait()
                    pdb.Pdb(readrc=False).set_trace()

                t = threading.Thread(target=start_pdb)
                t.start()
                pdb.Pdb(readrc=False).set_trace()
                evt.set()
                t.join()r}r~r�r�r�s
cont
cont
rr�r�res      r�test_issue36250�PdbTestCase.test_issue36250�s���
�)�"�"�D�
)�Q�
�G�G�H�O�O�%��$�V�G�_�
.�*� �~�~�t�Y�%5�%5�6�������?�?��/�/��?�?�=�R�Z�Z�=�!3�W�=�	��	
������)�)�*��)�)�/�:�������6�E�	G�3*�
)�r�c�x�SnSnSnURX5upEURX5SRX555 g)Nzdef f: pass
rizSyntaxError:zE

Expected:
{}
Got:
{}
Fail to handle a syntax error in the debuggee.)r�r8�format)rr�r�rr�r�s      r�test_issue16180�PdbTestCase.test_issue16180
sG��!����!���,�,��
���	
�
�
�h�
=�
�V�H�
%�	'rc��SnSnURX5up4URURS5S5 URURS5S5 g)Nz!import ast; ast.literal_eval('')
zA
            continue
            where
            quit
        zast.literal_eval('')r/r)r�r��count�rr�r�r�r�s     r�test_issue84583�PdbTestCase.test_issue84583*
sZ��6����
�,�,�V�>���
	
������&<�=�q�A�������&<�=�q�Arc��SnSnURX5up4SRUR5Vs/sHoUR5PM sn5nUR	US5 UR	US5 gs snf)Nzprint('hello')z[
            continue
            run a b c
            run d e f
            quit
        �
z#Restarting .* with arguments:
a b cz#Restarting .* with arguments:
d e f)r�rry�strip�assertRegex)rr�r�r�r��x�ress       r�test_issue26053�PdbTestCase.test_issue26053;
sv��!�����,�,�V�>����i�i�F�,=�,=�,?�@�,?�q����,?�@�A������D�E�����D�E��As�A:c�t�SnSnSn[SS5nUR[R"U55 SSS5 UR	[
RS5 URX5upVUR5nURSU5 URSU5 g!,(df   Nv=f)Nz~
            import bar
            def foo():
                ret = bar.bar()
                pass
            foo()
        zv
            b bar.bar
            c
            b main.py:5
            c
            p ret
            quit
        z:
            def bar():
                return 42
        ror��-> passz(Pdb) 42)
r�r�r�r�r�rr�r�ryr8)rr�r�r[r�r�r��liness        r�test_issue58956�PdbTestCase.test_issue58956I
s����������(�C�
 �A�
�G�G�H�O�O�C�(�)�!����	�(�(�(�3��,�,�V�>����!�!�#���
�
�i��'��
�
�j�%�(�
!�
 �s�&B)�)
B7c�z�SnSnURX5up4URSU5 URSU5 g)Nzx = 1zM
            step
            step
            step
            quit
        zThe program finishedzbdb.py�r�r8rdr9s     r�test_step_into_botframe�#PdbTestCase.test_step_into_botframeg
sC�������'�'��9�	���
�
�,�f�5�����6�*rc���[R"S5n[R"S5nURUSUSS9up4URSU5 UR	SU5 g)Nz-
            a = 1
            b = 2
        zU
            # Comments should be fine
            n
            p f"{a+8=}"
        �q
T�r�r��SyntaxErrorza+8=9)r�r�r�rdr8�rr�r�r�r�s     r�test_pdbrc_basic�PdbTestCase.test_pdbrc_basicu
sf�����"�
��
���!�
���,�,�V�U�%�UY�,�Z��������/��
�
�g�v�&rc���[R"S5n[R"S5nURUSUSS9up4URSU5 UR	SU5 g)Nz?
            a = 1
            b = 2
            c = 3
        z
            n

        r�Tr�zb = 2zc = 3)r�r�r�r8rdr�s     r�test_pdbrc_empty_line�!PdbTestCase.test_pdbrc_empty_line�
sh�����"�
�����!�
��
�,�,�V�U�%�UY�,�Z����
�
�g�v�&�����&�)rc��[R"S5n[R"S5nURUSUSS9up4URSU5 g)N��
            class A:
                def __init__(self):
                    self.attr = 1
            a = A()
            b = 2
        z�
            alias pi for k in %1.__dict__.keys(): print(f"%1.{k} = {%1.__dict__[k]}")
            until 6
            pi a
        r�Tr�z
a.attr = 1�r�r�r�r8r�s     r�test_pdbrc_alias�PdbTestCase.test_pdbrc_alias�
sV�����"�
�����!�
���,�,�V�U�%�UY�,�Z����
�
�l�F�+rc��[R"S5n[R"S5nURUSUSS9up4URSU5 g)Nr�z
            b 5;;c;;n
        r�Tr�z-> b = 2r�r�s     r�test_pdbrc_semicolon� PdbTestCase.test_pdbrc_semicolon�
sV�����"�
�����!�
���,�,�V�U�%�UY�,�Z����
�
�j�&�)rc��[R"S5n[R"S5nURUSUSS9up4URSU5 g)Nr�zK
            b 6
            commands 1 ;; p a;; end
            c
        r�Tr�z<__main__.A object atr�r�s     r�test_pdbrc_commands�PdbTestCase.test_pdbrc_commands�
sW�����"�
�����!�
���,�,�V�U�%�UY�,�Z����
�
�-�v�6rc�|�[R"S5nURUSSSS9up#URSU5 g)Nz$
            print('hello')
        r��invalidTr�z(NameError: name 'invalid' is not definedr�)rr�r�r�s    r�test_readrc_kwarg�PdbTestCase.test_readrc_kwarg�
sB�����"�
���,�,�V�U�)�Y]�,�^����
�
�@�&�Irc��[RRSS5n[R"5n[S5 [RRUS5nU[RRl	[US5nURS5 SSS5 UR[R"5RSS5 UbU[RS'SSS5 SSS5 g!,(df   Ng=f!UbU[RS'ff=f!,(df   ND=f!,(df   g=f)Nr�zos.path.expanduserr�r�r�r)r�r�r�r�temp_dirrrr�
expanduser�return_valuer�r�r�rvrw�rcLines)r�	save_homer��rc_pathr�s     r�test_readrc_homedir�PdbTestCase.test_readrc_homedir�
s����J�J�N�N�6�4�0�	�
�
�
�
!�X�u�5I�/J��g�g�l�l�8�X�6�G�.5�B�G�G���+�
3��'�3�'�1��G�G�I�&�(�� � �����!2�!2�1�!5�y�A��(�)2�B�J�J�v�&�0K�
!�
!�(�'���(�)2�B�J�J�v�&�)��0K�/J��
!�
!�sT�E�AD/�D�D�!:D�D/�1E�
D�D�D,�,D/�/
D=	�9E�
Ec�p�[5nSn[5nUR[SU55 UR[R"[
RS55 [
R"US9 SSS5 URUR5US-5 g!,(df   N2=f)Nz"Nobody expects... blah, blah, blahz
sys.stdout�	set_trace)�headerr�)
rr�
enter_contextr�objectrvrwr�r��getvalue)rr�r��	resourcess    r�test_header�PdbTestCase.test_header�
s}�����5��
�[�I��#�#�E�,��$?�@��#�#�E�L�L����+�$F�G��M�M��(��	
������*�F�T�M�:�	�[�s�A$B'�'
B5c��SnSnURX5up4UR[SUR555U5 g)Nzprint("SUCCESS")�/
            continue
            quit
        c3�,# �UH
nSU;v� M g7f��SUCCESSNr,rqs  rrt�.PdbTestCase.test_run_module.<locals>.<genexpr>�
����H�4G�q�I��N�4G�rv�r�rwrxryr�s     r�test_run_module�PdbTestCase.test_run_module�
sD��'�����,�,�V�>�������H�F�4E�4E�4G�H�H�&�Qrc��SnSnURX5up4UR[SUR555U5 g)NzQ
            if __name__ == '__main__':
                print("SUCCESS")
        r�c3�,# �UH
nSU;v� M g7fr�r,rqs  rrt�9PdbTestCase.test_module_is_run_as_main.<locals>.<genexpr>�
r�rvr�r�s     r�test_module_is_run_as_main�&PdbTestCase.test_module_is_run_as_main�
sF�������,�,�V�>�������H�F�4E�4E�4G�H�H�&�Qrc���SnURSS/USS9 UR/SQU5up#URSU5 UR/SQU5up#URSU5 g)	Nz
            continue
        �calendarr�r/�r�)r�r��1�December)r�r�z--type�text)r�r8�rr�r�r:s    r�test_run_module_with_args�%PdbTestCase.test_run_module_with_args�
sd����	
�
�
�z�4�(�(��
�J��M�M�"9�8�D�	���
�
�j�&�)��M�M�"F��Q�	���
�
�j�&�)rc�X�SnSnURXSS/S9up4URSU5 g)Nz@
            import sys
            print(sys.argv[1:])
        r�z--barr!)r�z['--bar', 'foo']r7r�s     r�test_run_script_with_args�%PdbTestCase.test_run_script_with_args
s>������
�,�,�V�G�UZ�K[�,�\����
�
�(�&�1rc���SnSnURX5up4UR[SUR555U5 UR[	SUR555U5 g)Nz{
            if __name__ == '__main__':
                pass
                print("SUCCESS")
                pass
        z*
            b 3
            quit
        c3�,# �UH
nSU;v� M g7f)zBreakpoint 1 atNr,rqs  rrt�.PdbTestCase.test_breakpoint.<locals>.<genexpr>#����P�<O�q�-��2�<O�rvc3�,# �UH
nSU;v� M g7fr�r,rqs  rrtr�$s���L�8K�1�I�Q�.�8K�rv)r�rwrxry�allr�s     r�test_breakpoint�PdbTestCase.test_breakpointsi�������,�,�V�>�������P�F�<M�<M�<O�P�P�RX�Y�����L��8I�8I�8K�L�L�f�Urc��SnURSS/U5up#UR[RUR	SS55 g)Nz(
            c
            quit
        r�rv�
ri)r�r8rv�_usage�replace)rr�r�r�s    r�test_run_pdb_with_pdb�!PdbTestCase.test_run_pdb_with_pdb&sB��������e�}�h�?����
�
��J�J��N�N�4��$�	
rc�F�Sn[R"U5 US-n[R"U5 [	US5 SSS5 UR[RU5 UR
SU/SSS9up4URSU5 g!,(df   NV=f)	Nr�r�r�r�rirr�z-ImportError: No module named t_main.__main__;)rr�r�r�r�r�r�r8)rr�r�r�r�s     r�test_module_without_a_main�&PdbTestCase.test_module_without_a_main1s���������%��.�0�	�
�����
�)�S�
!��"����	�(�(�+�6����
�;����'�
���	
�
�
�E�v�N�
"�
!�s�B�
B c�v�SnSn[R"U5 US-U-n[R"U5 [	US-S5 SSS5 UR[RU5 UR
SURSS5/SS	S
9upEURSU5 g!,(df   Nf=f)N�t_pkgr��/r�r�r��.rirr�z;'t_pkg.t_main' is a package and cannot be directly executed)	rr�r��makedirsr�r�r�r�r8)r�pkg_namer��modpathr�r�s      r�test_package_without_a_main�'PdbTestCase.test_package_without_a_main>s�����������"��S�.�;�.��
���G��
�'�N�*�C�
0��1����	�(�(�(�3����
�7�?�?�3��,�-�r�q�'�
���	
�
�
�I��	�
1�
0�s�B*�*
B8c��URS[R/SSS9upURS[R3U5 g)Nr�rirr�zImportError: No module named )r�rr�r8�rr�r�s   r�test_nonexistent_module�#PdbTestCase.test_nonexistent_moduleNsA������i�.>�.>�'?��YZ��[����
�
�5�i�6F�6F�5G�H�&�Qrc��[R"5nURU/SSS9up#URSUS3U5 SSS5 g!,(df   g=f)Nrirr�zError: z is a directory)rr�r�r8)rr�r�r�s    r�test_dir_as_script�PdbTestCase.test_dir_as_scriptSsK��
�
�
�
!�X�!�]�]�H�:�r�q�]�Q�N�F��M�M�G�H�:�_�=�v�F�"�
!�
!�s�+A
�

Ac���URS/SSS9upURSURS5S5 UR/SQSSS9upURS	URS5S5 g)
Nz-crir/r�z8pdb: error: argument -c/--command: expected one argumentr�r)z--spamr�rvz*pdb: error: unrecognized arguments: --spam)r�r8�splitrs   r�test_invalid_cmd_line_options�)PdbTestCase.test_invalid_cmd_line_optionsXss������v�r�q��I����
�
�P�SY�S_�S_�`d�Se�fg�Sh�i����'>��XY��Z����
�
�B�V�\�\�RV�EW�XY�EZ�[rc��SnSnURX5up4UR[SUR555U5 g)NzY
                #This is a comment, on line 2

                print("SUCCESS")
        z
            quit
        c3�,# �UH
nSU;v� M g7f)z__main__.py(4)<module>()Nr,rqs  rrt�=PdbTestCase.test_blocks_at_first_code_line.<locals>.<genexpr>hs���?�*=�Q�7� �!�*=�rvr�r�s     r�test_blocks_at_first_code_line�*PdbTestCase.test_blocks_at_first_code_line^sQ����
���,�,�V�>�������?�*0�*;�*;�*=�?�?�@F�	Hrc�z�SnSnURX5up4URSU5 URSU5 g)Nz$
            print("hello")
        z�
            filename = $_frame.f_code.co_filename
            f = open(filename, "w")
            f.write("print('goodbye')")
            import time; time.sleep(1)
            f.close()
            ll
        �WARNING:�
was editedr7r�s     r�"test_file_modified_after_execution�.PdbTestCase.test_file_modified_after_executionks@����
���,�,�V�>����
�
�j�&�)��
�
�l�F�+rc	�4�SnSnSn[US5nUR[R"U55 SSS5 UR	[
RU5 UR	[
RS5 [RU/n[R"U[R[R[R0[RESS0ES9nUR[ R#U55upxSSS5 W=(a [$R'U5nUR)WR*S	5 UR-S
U5 UR-SU5 g!,(df   GNE=f!,(df   N=f)Nz�
            import pdb; pdb.Pdb().set_trace()
            with open(__file__, "w") as f:
                f.write("print('goodbye')\n" * 5)
                import time; time.sleep(1)
            import pdb; pdb.Pdb().set_trace()
        z3
            continue
            continue
        r�r�r�r�r�r�rrr)r�r�r�r�r�rr�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r8)	rr�r�r�r�r�r�r�r:s	         r�:test_file_modified_after_execution_with_multiple_instances�FPdbTestCase.test_file_modified_after_execution_with_multiple_instances~s+������
��
�(�C�
 �A�
�G�G�H�O�O�F�+�,�!����	�(�(�(�3����	�(�(�-�8��~�~�x�(��
�
�
��!��� �o�o�!���A����A�%7��A�
���(�(����H�)=�>�I�F�
��0�E�L�L��0��������!�,��
�
�j�&�)��
�
�l�F�+�#!�
 ��

�
�s�&E7�)'F	�7
F�	
Fc��SnSnURX5up4URSU5 URSU5 URSU5 g)Nz�
            import random
            # Any code with a source to step into so this script is not checked
            # for changes when it's being changed
            random.randint(1, 4)
            print("hello")
        aL
            ll
            n
            s
            filename = $_frame.f_back.f_code.co_filename
            def change_file(content, filename):
                with open(filename, "w") as f:
                    f.write(f"print({content})")

            change_file('world', filename)
            restart
            ll
        �hello�worldrr�r�s     r�/test_file_modified_after_execution_with_restart�;PdbTestCase.test_file_modified_after_execution_with_restart�sR�������,�,�V�>����
�
�g�v�&��
�
�g�v�&�	
����V�,rc�V�SnSnURX5up4URSU5 g)NzZ
            def foo():
                raise ValueError("foo")
            foo()
        zX
            continue
            restart
            continue
            quit
        �
Restartingr7r�s     r�test_post_mortem_restart�$PdbTestCase.test_post_mortem_restart�s2�������,�,�V�>����
�
�l�F�+rc�f�SUl[R"UR5 URS-nURS-nURS-nUR[RUR5 [R
"UR5 [
US5nUR[R"S55 SSS5 [
US5nUR[R"S55 SSS5 [
US5nUR[R"S55 SSS5 S	nURS
UR/U5upgUR[SUR555U5 UR[SUR5555 UR[S
UR5555 g!,(df   GN4=f!,(df   GN=f!,(df   N�=f)Nr�r�r��
/module.pyr��6
                top_var = "VAR from top"
            z�
                from . import top_var
                from .module import var
                from . import module
                pass # We'll stop here and print the vars
            zY
                var = "VAR from module"
                var2 = "second var"
            zz
            b 5
            c
            p top_var
            p var
            p module.var2
            quit
        r�c3�,# �UH
nSU;v� M g7f�zVAR from moduleNr,rqs  rrt�4PdbTestCase.test_relative_imports.<locals>.<genexpr>�r�rvc3�,# �UH
nSU;v� M g7f)zVAR from topNr,rqs  rrtr(�s���M�9L�A�N�a�/�9L�rvc3�,# �UH
nSU;v� M g7f)z
second varNr,rqs  rrtr(�s���K�7J�!�L�A�-�7J�rv�r�rr�r�r�r�r�r�r�r�r�rwrxry�rr�r��module_filer�r�r�r:s        r�test_relative_imports�!PdbTestCase.test_relative_imports�s���#�������)�)�*��$�$�~�5�	��$�$�~�5�	��&�&��5�����	�(�(�$�*:�*:�;�
����!�!�"�
�)�S�
!�Q�
�G�G�H�O�O�%��
�"��)�S�
!�Q�
�G�G�H�O�O�%��
�"��+�s�
#�q�
�G�G�H�O�O�%��
�$�
���M�M�4��)9�)9�":�H�E�	������P�F�<M�<M�<O�P�P�RX�Y�����M��9J�9J�9L�M�M�N�����K�v�7H�7H�7J�K�K�L�7"�
!��"�
!��$�
#�s$�+&G>�%&H�&H"�>
H
�
H�"
H0c��SUl[R"UR5 URS-nURS-nURS-nUR[RUR5 [R
"UR5 [
US5nUR[R"S55 SSS5 [
US5nUR[R"S55 SSS5 [
US5nUR[R"S55 SSS5 S	nURS
URS-/U5upgUR[SUR555U5 g!,(df   N�=f!,(df   N�=f!,(df   N�=f)
Nr�z	/runme.pyr�r$r�r%zl
                from . import module
                pass # We'll stop here and print the vars
            z5
                var = "VAR from module"
            zQ
            b 3
            c
            p module.var
            quit
        r�z.runmec3�,# �UH
nSU;v� M g7fr'r,rqs  rrt�DPdbTestCase.test_relative_imports_on_plain_module.<locals>.<genexpr>r�rvr+r,s        r�%test_relative_imports_on_plain_module�1PdbTestCase.test_relative_imports_on_plain_module�sn��#�������)�)�*��$�$�{�2�	��$�$�~�5�	��&�&��5�����	�(�(�$�*:�*:�;�
����!�!�"�
�)�S�
!�Q�
�G�G�H�O�O�%��
�"��)�S�
!�Q�
�G�G�H�O�O�%��
�"�
�+�s�
#�q�
�G�G�H�O�O�%��
�$����M�M�4��)9�)9�H�)D�"E�x�P�	������P�F�<M�<M�<O�P�P�RX�Y�)"�
!��"�
!��
$�
#�s$�+&F#�%&F4�&G�#
F1�4
G�
Gc��SR/SQ5nURSUS-5up#URUR5SS/SQ5 g)Nr�)zprint(]zdebug print(zdebug doesnotexist�c�passr)
r�zU(Pdb) *** SyntaxError: closing parenthesis ']' does not match opening parenthesis '('�!(Pdb) ENTERING RECURSIVE DEBUGGERz%*** SyntaxError: '(' was never closed�LEAVING RECURSIVE DEBUGGERr8z> <string>(1)<module>()z9((Pdb)) *** NameError: name 'doesnotexist' is not definedr9�(Pdb) �rr�r�ryr�s    r�test_errors_in_command�"PdbTestCase.test_errors_in_commandsT���9�9�
����'�'���4��@�	������*�*�,�Q�R�0�3
�	rc�6^�U4SjnU"SS5 U"SS5 g)Nc�>�SRSU3S/5nTRSUS-5up4TRUR5SSSSUSU3S	/5 g)
Nr�zrun �qr7rr�z(Pdb) *** Cannot run z: r:r;)�bad_arg�msgr�r�r:rs     �r�check�*PdbTestCase.test_issue34266.<locals>.check0sx����y�y��w�i� ��"��H��+�+�F�H�t�O�D�I�F����V�.�.�0���4��'��y��3�%�8��7�
r�\zNo escaped character�"zNo closing quotationr,)rrCs` r�test_issue34266�PdbTestCase.test_issue34266.s ���
	�	�d�*�+�
�c�)�*rc�b�[R"S5nSn[R"5nS[R
R
U53nURX5upVURURS5SRS5U5 SSS5 g!,(df   g=f)N�Q
            import sys
            print('sys.path[0] is', sys.path[0])
        �c
q�(Pdb) sys.path[0] is r�r/r�)r�r�r�temp_cwdr�r�realpathr�r�r
�rstrip)rr�r��cwdrr�r�s       r�test_issue42384�PdbTestCase.test_issue42384>s������"�
����
�
�
�
!�S�.�r�w�w�/?�/?��/D�.E�F�H�!�0�0��B�N�F����V�\�\�$�/��2�9�9�$�?��J�"�
!�
!�s�A)B � 
B.c���[R"S5nSn[R"5n[R
R
U5n[R
RUS5n[R
RUS5nSU3n[R"U5 [[R
RUS5S5nURU5 SSS5 [R"U5 [R"[R
RUS5[R
RUS55 UR[R
RSS5/U5up�URURS5S	RS
5U5 SSS5 g!,(df   N�=f!,(df   g=f)NrJrK�dir_one�dir_tworL�foo.pyr�r�r/r�)r�r�rrMr�rrNrr�r�r��symlinkr�r�r
rO)
rr�r�rPrTrUrr�r�r�s
          r�test_issue42384_symlink�#PdbTestCase.test_issue42384_symlinkMsK�����"�
����
�
�
�
!�S��'�'�"�"�3�'�C��g�g�l�l�3�	�2�G��g�g�l�l�3�	�2�G�.�w�i�8�H��H�H�W���b�g�g�l�l�7�H�5�s�;�q������<��H�H�W���J�J�r�w�w�|�|�G�X�6������W�h�8W�X�!�]�]�B�G�G�L�L��H�,M�+N�PX�Y�N�F����V�\�\�$�/��2�9�9�$�?��J�"�
!�<�;��"�
!�s%�B%G�G�%CG�
G	�G�
G$c� �[R"S5nSn[R"5nUR	XSS0S9upES[
RRU53nURXd5 SSS5 g!,(df   g=f)Nzk
            import sys
            import random
            print('sys.path[0] is', sys.path[0])
        zc
�PYTHONSAFEPATHr�)r�zsys.path[0] is )	r�r�rrMr�r�rrNrd)rr�r�rPr�r:�
unexpecteds       r�test_safe_path�PdbTestCase.test_safe_pathfs������"�
��
���
�
�
!�S��+�+�F�IY�[^�H_�+�`�I�F�*�2�7�7�+;�+;�C�+@�*A�B�J����Z�0�	"�
!�
!�s�AA?�?
B
c��[R"5n[SS5n[R"S5nURU5 SSS5 [RRUS5n[R"U5 [R"[RRUS55 [RRUS5n[US5nURS5 SSS5 URS/S5upgSnURURS5S	RS
5U5 SSS5 g!,(df   GN=f!,(df   Ns=f!,(df   g=f)NrVr�z�
                    print('The correct file was executed')

                    import os
                    os.chdir("subdir")
                �subdirz$print("The wrong file was executed")zc
c
qz#(Pdb) The correct file was executedr�r+r�)rrMr�r�r�r�r�rrr�r�r�r
rO)	rrPr��sr`�
wrong_filer�r�rs	         r�test_issue42383�PdbTestCase.test_issue42383ws��
�
�
�
!�S��h��$���O�O�%�������
�%��W�W�\�\�#�x�0�F��H�H�V���H�H�R�W�W�\�\�&�(�3�4������f�h�7�J��j�#�&�!����>�?�'�"�]�]�H�:�y�A�N�F�<�H����V�\�\�$�/��2�9�9�$�?��J�)"�
!�$�$��'�&��"�
!�s<�
E9�(E�BE9�)E(�;AE9�
E%	� E9�(
E6	�2E9�9
Fc�|�Sn[R"S5nURX5up4URU5 g)Nz�            def func():
                def inner(v): pass
                inner(
                    42
                )
            func()
        zj
            break func
            continue
            next
            next
            jump 2
        )r�r�r��assertFalser�s     r�test_gh_94215_crash�PdbTestCase.test_gh_94215_crash�s@�����?�?�$�
���,�,�V�>������� rc��SnSnSn[SS5nUR[R"U55 SSS5 [SS5nUR[R"U55 SSS5 UR	[
RS5 UR	[
RS5 URS/U5upVURSUS5 g!,(df   N�=f!,(df   N�=f)	Nza
        def func():
            x = "Sentinel string for gh-93696"
            print(x)
        aL
        import os
        import sys

        def _create_fake_frozen_module():
            with open('gh93696.py') as f:
                src = f.read()

            # this function has a co_filename as if it were in a frozen module
            dummy_mod = compile(src, "<frozen gh93696>", "exec")
            func_code = dummy_mod.co_consts[0]

            mod = type(sys)("gh93696")
            mod.func = type(lambda: None)(func_code, mod.__dict__)
            mod.__file__ = 'gh93696.py'

            return mod

        mod = _create_fake_frozen_module()
        mod.func()
        zf
            break 20
            continue
            step
            list
            quit
        z
gh93696.pyr�zgh93696_host.pyz"x = "Sentinel string for gh-93696"zSentinel statement not found)	r�r�r�r�r�rr�r�r8)r�
frozen_src�host_programr�r�r�r�s       r�test_gh_93696_frozen_list�%PdbTestCase.test_gh_93696_frozen_list�s����
�
��*���,��
$��
�G�G�H�O�O�J�/�0�%��#�S�
)�Q�
�G�G�H�O�O�L�1�2�*�	
���	�(�(�,�7����	�(�(�*;�<����(9�':�H�E����
�
�:�F�Db�c�%�
$��*�
)�s�&C$�
&C5�$
C2�5
Dc��SnSnURX5up4URSU5 URX5up4URSU5 g)Nrir�z
main.py(0)z__main__.py(0))r�r8r�r9s     r�test_empty_file�PdbTestCase.test_empty_file�sO�������'�'��9�	���
�
�l�F�+��'�'��9�	���
�
�&��/rc�P�[RR[RR[5S5n[R
"U5HKnUR
S5(dMUR[RRX5/S5 MM g)N�encoded_modulesz.pyr@)r�rr�dirnamerF�listdir�endswithr�)r�
script_dirr�s   r�test_non_utf8_encoding�"PdbTestCase.test_non_utf8_encoding�sf���W�W�\�\�"�'�'�/�/�(�";�=N�O�
��
�
�:�.�H�� � ��'�'��
�
�r�w�w�|�|�J�A�B�C�H�/rc��[R"5n[R"[RRUS55 [R"S5n[[RRUSS5S5nURU5 SSS5 [R"[RRUS5[RRUS55 UR[RRUS5/SR/SQ55upEURSU5 URS	U5 SSS5 g!,(df   N�=f!,(df   g=f)
N�sourcezg
                def f(x):
                    return x + 1
                f(21 + 21)
                z__main__.pyr�z
zipapp.pyzr�)zb fr6zp xr@�42zreturn x + 1)rr�r�r�rrr�r�r�r��zipapp�create_archiver�r8)rr�r�r�r�r:s      r�test_zipapp�PdbTestCase.test_zipapp�s��
�
�
�
!�X��H�H�R�W�W�\�\�(�H�5�6��_�_���F��b�g�g�l�l�8�X�}�E�s�K�q������L��!�!�"�'�'�,�,�x��"B�"$�'�'�,�,�x��"F�
H��
�
�r�w�w�|�|�H�l�'K�&L�d�i�i�Y�O��I�F�
�M�M�$��'��M�M�.�&�1�)"�
!�L�K��"�
!�s%�A6E;�E*�CE;�*
E8	�4E;�;
F	c�V�SnSnURX5up4URSU5 g)Nz�
            def foo():
                pass

            class C:
                def foo(self):
                    pass
        z2
            break C.foo
            quit
        z.The specified object 'C.foo' is not a functionr7r�s     r�test_issue_59000�PdbTestCase.test_issue_59000�s3�������,�,�V�>����
�
�F��Or)r�)rN)rNNNF)Lr'r(r)r*r��unittest�skipIfr�flags�	safe_pathr�r�r�rrr
rr"r(r,r2r;rXrarfrlrzr�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrr!r.r3r<rGrQr�skip_unless_symlinkrXr]rcrgrlrorwr~r�r+r,rrr�r��s���+��_�_�S�Y�Y�(�(�>�@�&'���@��6,-�!%�#'�!�#(��:A�F�9�
��5�
� 
�"
�
&�'1�R=�2
M�V�*";�HG�8G�<�'��'��B��B� F�)�<+�'� *�$,�$*� 7�$J�3�;�R�
R�
*�2�
V�	
�O�� R�
G�
\�H�,�&!,�F-�>,�"#M�JZ�>�2+� 
K��"�"�K�#�K�01�"K�.!�&,d�\0�I�2�.Prr�c�2�\rSrSrSrSrSrSrSrSr	g)	�ChecklineTestsic�.�[R"5 gr)�	linecache�
clearcachers r�setUp�ChecklineTests.setUps�����rc�L�[R"[R5 grr�rs rr��ChecklineTests.tearDownr�rc��[[RS5nURS5 SSS5 [R
"5nUR
UR[RS5S5 g!,(df   NT=f�Nr�z
print(123)r)r�rr�r�rvrwr��	checkline�rr��dbs   r�test_checkline_before_debugging�.ChecklineTests.test_checkline_before_debuggingsZ��
�)�"�"�C�
(�A�
�G�G�L�!�)�
�W�W�Y��������i�&6�&6��:�A�>�)�
(�s�A;�;
B	c�8�[[RS5nURS5 SSS5 [R
"5nUR
5 URUR[RS5S5 g!,(df   Nd=fr�)	r�rr�r�rvrw�resetr�r�r�s   r�test_checkline_after_reset�)ChecklineTests.test_checkline_after_resetsc��
�)�"�"�C�
(�A�
�G�G�L�!�)�
�W�W�Y��
���
�������i�&6�&6��:�A�>�	)�
(�s�B�
Bc��[R"S5n[[RS5nURU5 SSS5 [
UR55S-n[[55 [R"5n[U5H2nURUR[RU55 M4 SSS5 g!,(df   N�=f!,(df   g=f)Nz\
            # Comment
            """ docstring """
            ''' docstring '''

        r�r/)r�r�r�rr�r��lenryrrrvrw�rangerfr�)rrar��	num_linesr��linenos      r� test_checkline_is_not_executable�/ChecklineTests.test_checkline_is_not_executables����O�O��

���)�"�"�C�
(�A�
�G�G�A�J�)������'�!�+�	�
�X�Z�
(�����B��	�*��� � ����i�.>�.>��!G�H�+�)�
(�)�
(��)�
(�s�C�:AC+�
C(�+
C9r,N)
r'r(r)r*r�r�r�r�r�r+r,rrr�r�s���+�?�?�Irr�c�B�\rSrSr\S5rSrSrSrSr	Sr
Srg	)
�PdbTestReadlinei,c�f�[S5nURS:Xa[R"S5eg)N�readline�editlinez)libedit readline is not supported for pdb)r	�backendr��SkipTest)�clsr�s  r�
setUpClass�PdbTestReadline.setUpClass/s3��!��,�����z�)��#�#�$O�P�P�*rc���[R"S5nSn[X5nURSU5 URSU5 URSU5 URSU5 g)Nz�
            import pdb; pdb.Pdb().set_trace()
            # Concatenate strings so that the output doesn't appear in the source
            print('hello' + '!')
        s
co		ntin	
scommandss	conditionscontinueshello!�r�r�r
r8�rr�rrks    r�test_basic_completion�%PdbTestReadline.test_basic_completion7s^�����"�
��"����'���
�
�k�6�*��
�
�l�F�+��
�
�k�6�*��
�
�i��(rc���[R"S5nSnUS-
nUS-
nUS-
n[X5nURSU5 URSU5 URSU5 g)	N�S
            value = "speci"
            import pdb; pdb.Pdb().set_trace()
        sval	 + 'al'
sp val	 + 'es'
s$_fra	
�c
�specialsspeciess$_framer�r�s    r�test_expression_completion�*PdbTestReadline.test_expression_completionIsn�����"�
��"��
�$�$��
����
������'���
�
�j�&�)��
�
�j�&�)��
�
�j�&�)rc�x�[R"S5nSnUS-
n[X5nURSU5 g)Nr�spri	val	 + 'al')
r�r�r�r�s    r�test_builtin_completion�'PdbTestReadline.test_builtin_completion^s?�����"�
��(��	������'���
�
�j�&�)rc�x�[R"S5nSnUS-
n[X5nURSU5 g)Nz�
            def f():
                original = "I live Pythin"
                import pdb; pdb.Pdb().set_trace()
            f()
        sorig	.repl	('i', 'o')
r�s
I love Pythonr�r�s    r�test_local_namespace�$PdbTestReadline.test_local_namespacens@�����"�
��-��	������'���
�
�&��/rc��[R"S5nSnUS-
nUS-
nUS-
nUS-
n[X5nURSU5 g)Nz7
            import pdb; pdb.Pdb().set_trace()
        sdef func():
s
	ret	 40 + 2
�
sfun	()
r�s42r�r�s    r�test_multiline_completion�)PdbTestReadline.test_multiline_completion�s[�����"�
��!��
�$�$��
����
����
������'���
�
�e�V�$rr,N)r'r(r)r*�classmethodr�r�r�r�r�r�r+r,rrr�r�,s1���Q��Q�)�$*�**� 0�$%rr�c�\�SSKJn UR[R"U55 U$)Nr)�test_pdb)�testr��addTest�doctest�DocTestSuite)�loader�tests�patternr�s    r�
load_testsr��s!���	�M�M�'�&�&�x�0�1��Lr�__main__)mr�r�rvr�typesr0r�r�r�r�r|�
contextlibrr�iorr�r�test.supportrr�test.support.import_helperr	�test.support.pty_helperr
r�
unittest.mockr�has_socket_support�SKIP_ASYNCIO_TESTSr�rr.r1r6r8r:r<r>r@rBrDrHrJrLrNrPrRr��no_siterTrVrXrZr\r^r`rbrdrfrhrjrl�
ModuleType�modrN�__dict__rorqrzr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��requires_subprocess�TestCaser�r�r�r�r'�mainr,rr�<module>r�s����	�
�
��
�����
�1���7�4�6��"�4�4�4��*�6�*�"�8W�r&�B�H"�H&�PA�F�4�@	��a�F'�R=�~G�R8�z�y�y���2�hY�xN�b5�pG�T"�J"�J�*b�J?�D1�h�4�:���'�(���=�s�|�|�L�,�^+�\?�

� �,>�@=�~�:�x?�B9�v�,�\.�`�1�f(�T1�f �D=�~&�P�2�:/�bD�L�8�2�(�"�"�>�.�6�01�f'�R1�h	����WP�(�#�#�WP��WP�t""I�X�&�&�"I�J	����b%�h�'�'�b%��b%�J��z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit