403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
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:/Python315/Lib/test/test_pyrepl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_pyrepl/__pycache__/test_pyrepl.cpython-315.opt-2.pyc
R
>lqj��c�`�Q<sb.s]PHs]PHs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]PH4s
]QH8Gs]QHGs]QHDGsGsGs]QHTGsGs]PH`s]QHdGsGsGsGsGs]QHdGsG s G!s!]QH�G#s#]QH�G%s%G&s&]Q	H�G(s(G)s)G*s*G+s+G,s,G-s-G.s.]Q
H�G0s0G1s1]QH�G3s3]QH�G5s5]Q
H�G7s7]QH�G9s9G:s:G;s;]QH�G=s>G?s?]PCHGAsB]QCHGCsCGDsDGEsE]QCHG-sF]PCHsG]PCHsI]PCH*sJQQ\2sKQQ\2sLQQ\2sMQQ\)\2sNQQ\2sOQQ\2sPQQ\2sQQ Q!\2sRPrS\]jQ"Q#ksT\O�\T2\O�Q$2sWQ%Q&\2sXQ'Q(\2sYQ)Q*\2sZ\\GQ+2Q,Q-\K22s[Q.s\\\GQ+2\\\2Q/2Q0Q1\K222s]\\O�Q26HQ32Q4Q5\]22s_Q6Q7\2s`\\O�Q86HQ92Q:Q;\22saP!\HcPsGCKYh9h\HcPsICKch9h\HcPsJCKmh9h)=�)�partial��
ModuleInfo)�TestCase�
skipUnless�SkipTest)�Mock�patch)�captured_stdout�captured_stderr�force_not_colorized�make_clean_env�Py_DEBUG)�has_subprocess_support�
SHORT_TIMEOUT�
STDLIB_DIR)�
import_module)�EnvironmentVarGuard�unlink)�FakeConsole�ScreenEqualMixin�handle_all_events�handle_events_narrow_console�
more_lines�multiline_input�code_to_events)�
ANSIColors�	get_theme)�terminfo)�Event)�
stripcolor)�ImportParser�ModuleCompleter�HARDCODED_SUBMODULES)�	Completer�colorize_matches)�ReadlineAlikeReader�ReadlineConfig�_ReadlineWrapper)rc�h`�\sQs]GsnQsQQPQPQP
Q\QP-U1QkQkkksU1Q	kQ
ksQsUs	P!)
�ReplTestCasec�6�[%f[Q2gP!)ztest module requires subprocess)rr��selfs&�1C:\Python315\\Lib\test\test_pyrepl\test_pyrepl.py�setUp�ReplTestCase.setUpHs��%�%��<�=�=�&��cmdline_args�cwd�skip�timeout�exit_on_outputc��:�U]6�cPgQRZRZRZ**QRZP*QRZRZ*P*QRZP*QRZQRZQRZP*QRZRZRZ1*-!�	��
repl_input�envr2r3r4r5r6�return��str�list�dict�bool�float�tuple�int)�format�
__classdict__s"�r.�__annotate__�"ReplTestCase.run_repl.__annotate__Ls����#�#��$�s�)�O�#��D�[�#�
�3�i�$�&�#��4�Z�
#��#��#��d�
�#�
�s�C�x��#r1c
���PoUe$[OP	Q5oUOoUOUUUUUUUQ5UdUO	2!!SdSO	2hh9h)N)�ignore_cleanup_errors)r;r2r3r4r5r6)�tempfile�TemporaryDirectory�name�	_run_repl�cleanup)	r-r:r;r2r3r4r5r6�temp_dirs	&&&$$$$$ r.�run_repl�ReplTestCase.run_replLs������;��2�2��N�H��-�-�C�	#��>�>���)����-�"���#�� � �"�$��x�#�� � �"�$�s�A�A0�A0c�:�U]6�cPgQRZRZRZ**QRZP*QRZRZ*P*QRZQRZQRZQRZP*QRZRZRZ1*-!r8r=)rErFs"�r.rG�#ReplTestCase._run_repl.__annotate__is����K!�K!��$�s�)�O�K!��D�[�	K!�
�3�i�$�&�K!��
K!��K!��K!��d�
�K!�
�s�C�x��K!r1c�r�[O2vq�[OQQ,o
UeU
O	Q2L*QU7c$[
OOUQ2UQ$UdU
OU2]PH&oUOU	2o]U]*UO$]U]*UO$UOV�OU2[ O"S
S	S	S	SP	P	U%cSL[
O$Q5o
[
O&U	2[)U[*2%cQOU2Q*o[
O,V�O/Q22,o[0O0U,,,U2]*%c{[
O2UQ2O5Q2oU%fL�UO	U2UeJoPOU2,oV~]*7fJ�U
O92L[[
O&U2U
O92U
O;UQ	5UO=Q
POU202[
O&U2U
O;UQ	5oPOU2oU%cQU7cUOAQ2UU1![cCK	h9h[6cJ~h9h[ O>c$S
O92S
O;2oK�h9h)
z-iz-uz-I�PYTHON_HISTORYz.regrtest_history)�stdin�stdout�stderrr3�text�	close_fdsr;�
�utf-8�)r5z'Timeout while waiting for output, got: zcan't use pyreplzpyrepl not available)!�pty�openpty�sys�
executable�append�os�path�join�extend�termios�	tcgetattr�VREPRINT�VINTR�	tcsetattr�TCSANOW�ModuleNotFoundError�
subprocess�Popen�environ�close�
isinstancer?�write�encode�select�read�decode�OSError�kill�wait�fail�TimeoutExpired�skipTest)r-r:r;r2r3r4r5r6�	master_fd�slave_fd�cmdrh�	term_attr�process�output�data�	exit_codes&&$$$$$$         r.rN�ReplTestCase._run_replis���"�k�k�m��	��~�~�t�T�*���;��J�J�t��
�S�
(�$&�G�G�L�L��6I�$J�C� �!��#��J�J�|�$�	D�� �)�)�(�3�I�-.�I�a�L��)�)�*�*+�I�a�L����'����h����C��"�"�����������
�
�	
��	������j�$�'�'����:�.��5�J�
����-�-�g�6�7����m�m�Y�K��R��9�!�<�<�
��w�w�y�$�/�6�6�w�?�����
�M�M�$���)��'�'�&�/�*��!�A�Y�.��L�L�N���H�H�Y���L�L�N��L�L��L�)��I�I�?������?P�Q�R�
�����	'����W��5�I��������&�&�0��M�M�0�1��y� � ��i#�	��	��:�
��
��"�(�(�	'��L�L�N�����I�	'�sH�K�(-K,�K>�	K)�$K)�(K)�,	K;�6K;�:K;�>L6�!L6�5L6��N)
�__name__�
__module__�__qualname__�__firstlineno__r/rrQrN�__static_attributes__�__classdictcell__�rFs@r.r*r*GsR����>�#�
*.�#��
#��#�'�#�&*�#�#�:K!�K!r1r*c�`�\sQs]�snQsQsQsQsQsQs	Qs
QsQ	sQ
s
QsQsQ
sQsQsQsQsUsP!)�TestCursorPositionc�N�[U2o[PQ5o[V#Q5oU!�N)�readline_completer��console�config�rr'r&�r-�eventsr�r��readers&&   r.�prepare_reader�!TestCursorPosition.prepare_reader��%���f�%���4�8��$�W�D���
r1c
��Qo[O[U2[QQ[	Q2Q5,2o[U2vq4UO
UOQ2UOO]]2P!)�def f():
  ...
�key�up�OA��evtr��raw)r��
�	itertools�chainrr�	bytearrayr�assertEqual�cxy�move_cursor�assert_called_once_with�r-�coder�r�r�s&    r.�test_up_arrow_simple�'TestCursorPosition.test_up_arrow_simple�sr��
�	
�
����4� ��%�d�	�)�0D�E�
�
��,�F�3���������V�,����3�3�A�q�9r1c
��Qo[O[U2[QQ[	Q2Q5,2o[U2vq4UO
UOQ2UOO]]2P!)r�r��down�OBr�)rr9r�r�s&    r.�test_down_arrow_end_of_input�/TestCursorPosition.test_down_arrow_end_of_input�sr��
�	
�
����4� ��%�f�)�I�2F�G�
�
��,�F�3���������V�,����3�3�A�q�9r1c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UOQ2UOO]]2P!)�11+11r��left�ODr�)�rr��r-r�r�r�s&   r.�test_left_arrow_simple�)TestCursorPosition.test_left_arrow_simple�sf������7�#��%�f�)�I�2F�G�
�
��,�F�3���������V�,����3�3�A�q�9r1c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UOQ2UOO]]2P!)r�r��right�OCr�)�rr�r�s&   r.�test_right_arrow_end_of_line�/TestCursorPosition.test_right_arrow_end_of_line�sf������7�#��%�g�9�Y�3G�H�
�
��,�F�3���������V�,����3�3�A�q�9r1c���[O[Q22o[U2vq#UO	UO
]2UO	UOQ2P!)�k)r�r�r�r�rrr��posr��r-r�r��_s&   r.�%test_cursor_position_simple_character�8TestCursorPosition.test_cursor_position_simple_character�sK�������!4�5��%�f�-�	��������Q�'�	
������V�,r1c���[O[Q22o[U2vq#UO	UO
]2UO	UOQ2P!)�樂�r9rr�r�s&   r.�+test_cursor_position_double_width_character�>TestCursorPosition.test_cursor_position_double_width_charactersK�������!6�7��%�f�-�	��������Q�'�	
������V�,r1c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UO]2UO
UOQ2P!)r�r�r�r�r��rr�	r�r�rrr�rr�r�r�r�s&   r.�5test_cursor_position_double_width_character_move_left�HTestCursorPosition.test_cursor_position_double_width_character_move_leftsd������5�!��%�f�)�I�2F�G�
�
��&�f�-�	��������Q�'�������V�,r1c�*�[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5,2o[U2vq#UO
UO]2UO
UOQ2P!)r�r�r�r�r�r�r�r�r�r�s&   r.�;test_cursor_position_double_width_character_move_left_right�NTestCursorPosition.test_cursor_position_double_width_character_move_left_rightsw������5�!��%�f�)�I�2F�G��%�g�9�Y�3G�H�
�
��&�f�-�	��������Q�'�	
������V�,r1c
�4�QoUQ0o[O[U2[QQ[	Q2Q5,2o[U2vqEUO
UO[U22UO
UO[U2]12P!)�for _ in _:� 
  ' 可口可乐; 可口可樂'r�r�r�r��
r�r�rrr�rr�r��lenr��r-�for_loopr�r�r�r�s&     r.�4test_cursor_position_double_width_characters_move_up�GTestCursorPosition.test_cursor_position_double_width_characters_move_up's��� ���Z�.�.�	
�����4� ��%�d�	�)�0D�E�
�
��&�f�-�	��	
������S��]�3�������c�(�m�Q�%7�8r1c�d�QoUQ0o[O[U2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q	2Q5,2o[U2vqEUO
UO]2UO
UOQ
2P!)r�r�r�r�r�r�r�r�r�r�)�
r�r�r�s&     r.�9test_cursor_position_double_width_characters_move_up_down�LTestCursorPosition.test_cursor_position_double_width_characters_move_up_down>s��� ���Z�.�.�	
�����4� ��%�d�	�)�0D�E��%�f�)�I�2F�G��%�f�)�I�2F�G�
�
��&�f�-�	��
	
������R�(�������W�-r1c�V�[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2o[U2vq#UO
UO]
2UO
UOQ2P!)u' 可口可乐; 可口可樂'r�r�r�r�)�rr�r�s&   r.�?test_cursor_position_multiple_double_width_characters_move_left�RTestCursorPosition.test_cursor_position_multiple_double_width_characters_move_leftYs�������:�;��%�f�)�I�2F�G��%�f�)�I�2F�G��%�f�)�I�2F�G�
�
��&�f�-�	��������R�(�	
������W�-r1c��QoQoUQUQ0o[O[U2[QQ[	Q2Q5[QQ[	Q2Q5,2o[U2vqVUO
UO[U2[U2*]*2UO
UO[U2]12P!)r�z  hellor\z

  h
  helr�r�r�r�r�)r-�
first_line�second_liner�r�r�r�s&      r.�#test_cursor_position_move_up_to_eol�6TestCursorPosition.test_cursor_position_move_up_to_eoljs���"�
����l�"��m��
�	
�����4� ��%�d�	�)�0D�E��%�d�	�)�0D�E�
�
��&�f�-�	��	
����J�J��J��#�k�*:�:�Q�>�	
�	
������c�+�&6��%:�;r1c
��QoQU0o[O[U2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2o[U2vqEUO
UO[U22UO
UO[U2]12P!)z  helzfor _ in _:
  hello
  h
r�r�r�r�r�r�r�)r-�	last_liner�r�r�r�s&     r.�%test_cursor_position_move_down_to_eol�8TestCursorPosition.test_cursor_position_move_down_to_eol�s����	�
��[�
�	
�����4� ��%�d�	�)�0D�E��%�d�	�)�0D�E��%�f�)�I�2F�G��%�f�)�I�2F�G�	
�
��&�f�-�	��	
������S��Y�/�������c�)�n�a�%8�9r1c�>�Qo[O[U2]
[QQ[	Q2Q5,*[QQ[	Q2Q5,2o[U2vq4UO
UO]2UO
UOQ2P!)uIdef foo():
  x = '可口可乐; 可口可樂'
  y = 'abckdfjskldfjslkdjf'r�r�r�r�r�r�)�r�r��r-r�r�r�r�s&    r.�1test_cursor_position_multiple_mixed_lines_move_up�DTestCursorPosition.test_cursor_position_multiple_mixed_lines_move_up�s���
*�	
�����4� ��%�E��I�i�4H�I�J�J�
�u�4�Y�y�-A�
B�C�
��&�f�-�	��	
������R�(�������W�-r1c
��Qo[O[U2[QQ[	Q2Q5,2o[U2vq4UO
UO]
2UO
UOQ2P!)zdef foo():
  hellor�r�r�r�)r�r�)	r�r�rrr�rr�r�r�r�s&    r.�+test_cursor_position_after_wrap_and_move_up�>TestCursorPosition.test_cursor_position_after_wrap_and_move_up�sr��
�	
�����4� ��%�d�	�)�0D�E�
�
��1��8�	��	
������R�(�������V�,r1r�)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s@r.r�r��s\�����:�$:�$
:�
:�-�-�
-�
-�9�..�6.�"<�B:�@.�4-�-r1r�c�R`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sUs
P!)�TestPyReplAutoindent��c�N�[U2o[PQ5o[V#Q5oU!r�r�r�s&&   r.r��#TestPyReplAutoindent.prepare_reader�r�r1c��QoQo[U2oUOU2o[U2oUOVR2P!)zdef f():
pass

zdef f():
    pass
    �rr�rr��r-�
input_code�output_coder�r�r�s&     r.�test_auto_indent_default�-TestPyReplAutoindent.test_auto_indent_default�sJ��
�	�
�	� �
�+���$�$�V�,�� ��(������-r1c
���[O[Q2[QQ[	Q2Q5,[Q22oQoUOU2o[
U2oUOVB2P!)�	def f():
r��	backspace�r��
  pass
pass

zdef f():
  pass
  pass
  �r�r�rrr�r�rr��r-r�rr�r�s&    r.�test_auto_indent_continuation�2TestPyReplAutoindent.test_auto_indent_continuation�su������<�(��%�k�y��7I�J�
�
��
�

��
�	��$�$�V�,�� ��(������-r1c
��[O[Q2[QQ[	Q2Q5,[Q2[Q22oQoUOU2o[
U2o[
U2oUOVR2P!)rr�r
rr�rzdef g():
pass

zdef g():
  pass
  r)r-r�rr��output1�output2s&     r.�test_auto_indent_prev_block�0TestPyReplAutoindent.test_auto_indent_prev_blocks�������<�(��%�k�y��7I�J�
�
��
�
��
�
��"
�	��$�$�V�,��!�&�)��!�&�)������.r1c���[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,[Q	2[QQ
[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2oQoUOU2o[
U2oUOVB2P!)
z
def f():
passr�r�r�r��sO5r\�
�passr�r�zdef f():
    pass
    pass
    rrs&    r.�test_auto_indent_multiline�/TestPyReplAutoindent.test_auto_indent_multiline2s��������
��%�d�	�)�0D�E��%�f�)�I�2F�G��%�d�	�%�0@�A�
�
��
�
�%�f�)�I�2F�G��%�f�)�I�2F�G��%�d�	�%�0@�A��%�d�	�%�0@�A�

�
��4
�	��$�$�V�,�� ��(������-r1c�|�[Q2oQoUOU2o[U2oUOVB2P!)zdef f():  # foo
pass

zdef f():  # foo
    pass
    rrs&    r.�test_auto_indent_with_comment�2TestPyReplAutoindent.test_auto_indent_with_commentY�E���
�
��
�	��$�$�V�,�� ��(������-r1c�|�[Q2oQoUOU2o[U2oUOVB2P!)zdef f():  ## foo
pass

zdef f():  ## foo
    pass
    rrs&    r.�"test_auto_indent_with_multicomment�7TestPyReplAutoindent.test_auto_indent_with_multicommentkr"r1c�|�[Q2oQoUOU2o[U2oUOVB2P!)z	pass  #:
zpass  #:rrs&    r.� test_auto_indent_ignore_comments�5TestPyReplAutoindent.test_auto_indent_ignore_comments}sC����
��

�	�
�$�$�V�,�� ��(������-r1r�)r�r�r�r�r�r	rrrr r$r'r�r�r�s@r.rr�s3�����.�&.�6/�>%.�N.�$.�$
.�
.r1rc�|`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sQsQsQsQsUsP!)�TestPyReplOutput�c�\�[U2o[PQ5o[V#Q5oP
UmU!r�)rr'r&�can_colorizer�s&&   r.r��TestPyReplOutput.prepare_reader�s-���f�%���4�8��$�W�D��#����
r1c��[O[OO	22%cP!UOQ2P![c oSOQS02Po=P!Po=hh9h)Nzstdin is not a ttyzstdin tty check failed: )rd�isattyrarW�filenor~ry�r-�oses& r.�test_stdin_is_tty�"TestPyReplOutput.test_stdin_is_tty�sc��	0��y�y����)�)�+�,�,��-�

�M�M�.�/���	<��M�M�4�S�E�:�;�;��	<���7A�	A;�A;�A6�6A;c��[O[OO	22%cP!UOQ2P![c oSOQS02Po=P!Po=hh9h)Nzstdout is not a ttyzstdout tty check failed: )rdr0rarXr1r~ryr2s& r.�test_stdout_is_tty�#TestPyReplOutput.test_stdout_is_tty�sc��	1��y�y����*�*�,�-�-��.�

�M�M�/�0���	=��M�M�5�c�U�;�<�<��	=�r6c��UO[Q22o[U2oUOUQ2UO	UQP	Q5P!)z1+1
�1+1��clean)r�rrr��assert_screen_equal)r-r�r�s&  r.�
test_basic�TestPyReplOutput.test_basic�sF���$�$�^�G�%<�=�� ��(�������'�� � ���d� �;r1c��UO[Q22o[PPUQ5oUO[	UO22[2P!)r\)�f_in�f_outr�)r�rr(�assertIs�type�get_line_bufferr>)r-r��wrappers&  r.� test_get_line_buffer_returns_str�1TestPyReplOutput.test_get_line_buffer_returns_str�sA���$�$�^�D�%9�:��"��D��H���
�
�d�7�2�2�4�5�s�;r1c�F�[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ	[	Q
2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ
[	Q2Q5[QQ[	Q
2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2oQoUOV42UOV$P	Q5[
U2oQoUOV42UOV$P	Q5P!)zdef f():
...

r�r�r�r�r�r�r
��g�gr�r��deleterr��p�p�a�a�s�sr\rzdef f():
    ...
    r<zdef g():
    pass
    �	r�r�rrr�r�rr�r>)r-r�r�r��expecteds&    r.�test_multiline_edit�$TestPyReplOutput.test_multiline_edit�s�������.�/��%�d�	�)�0D�E��%�d�	�)�0D�E��%�f�)�I�2F�G��%�f�)�I�2F�G��%�f�)�I�2F�G��%�k�y��7I�J��%�c�y���?��%�f�)�I�2F�G��%�k�y��7I�J��%�h�I�g�4F�G��%�g�9�T�?�C��%�k�y��7I�J��%�c�y���?��%�c�y���?��%�c�y���?��%�c�y���?��%�d�	�%�0@�A��%�d�	�%�0@�A�%
�
��.�$�$�V�,�� ��(��,������*�� � ��� �>� ��(��-������*�� � ��� �>r1c��[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2oUOUQ2UOUQP	Q5[
U2oUOUQ	2UOUQ	P	Q5[
U2oUOUQ	2UOUQ	P	Q5[
U2oUOUQ2UOUQP	Q5P!)
�1+1
2+2
r�r�r�r�r\rr;r<�2+2rU�r-r�r�r�s&   r.�%test_history_navigation_with_up_arrow�6TestPyReplOutput.test_history_navigation_with_up_arrow�sQ������<�(��%�d�	�)�0D�E��%�d�	�%�0@�A��%�d�	�)�0D�E��%�d�	�)�0D�E��%�d�	�)�0D�E��%�d�	�%�0@�A�

�

���$�$�V�,�� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;r1c���Qo[[O[U2[	QQ[Q2Q5[	QQ[Q2Q5[	QQ[Q2Q5[	QQ[Q2Q5[	QQ[Q2Q5,22oUO
U2o[U2o[U2o[U2oQoUOV5P	Q5UOVE2P!)	z4def foo():
x = 1
y = 2
z = 3

def bar():
return 42

r�r�r�r�r\rz-def foo():
    x = 1
    y = 2
    z = 3
    r<)
r?r�r�rrr�r�rr>r�)r-r�r�r�r�rVs&     r.�#test_history_with_multiline_entries�4TestPyReplOutput.test_history_with_multiline_entries�s���M���i�o�o��4� ��%�d�	�)�0D�E��%�d�	�)�0D�E��%�d�	�)�0D�E��%�d�	�%�0@�A��%�d�	�%�0@�A�
�	
�	���$�$�V�,�� ��(�� ��(�� ��(��F��� � ��� �>�����*r1c
��Qo[[O[U2[	QQ[Q2Q5[	QQ[Q2Q5,22oUO
U2o[U2[U2Qo[[PQ5Um	Q9Um
UmQ9UmUm
UO2UO2UO!2UO#UO$]2UO#UO'2U2UO(oUO!2UO#UO$]2UO#UO'2U2UO+UO(]*U]*2UO-2P!SO-2h9h)	zPdef fo():
...
...
a = 1
b = 2
x = 1

def fo():
...
...
a = 1
b = 2
x = 1
z = 2

r�r�r�r�zAdef fo():
    ...
    ...
    a = 1
    b = 2
    x = 1
    z = 2��	namespacez>>> z... )r?r�r�rrr�r�rrr�ps1�ps2�ps3�ps4�prepare�refresh�handle1r��historyi�get_unicoder��
assertLess�restore)r-r�r�r�rV�	first_cxys&     r.�3test_up_arrow_stays_within_recalled_multiline_entry�DTestPyReplOutput.test_up_arrow_stays_within_recalled_multiline_entry	sj��
�	
�"�i�o�o��4� ��%�d�	�)�0D�E��%�d�	�)�0D�E�
�
����$�$�V�,��������
�	�$�J�$�?���"(�(��
�V�Z�"(�(��
�V�Z�	��N�N���N�N���N�N�����V�_�_�a�0����V�/�/�1�8�<��
�
�I��N�N�����V�_�_�a�0����V�/�/�1�8�<��O�O�F�J�J�q�M�9�Q�<�8��N�N���F�N�N��s
�5C.F5�5Gc��[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2oUOUQ	2UOUQ	P	Q
5P!)rZr�r�r�r�r\rr�r�r;r<rUr\s&   r.�'test_history_navigation_with_down_arrow�8TestPyReplOutput.test_history_navigation_with_down_arrowDs�������<�(��%�d�	�)�0D�E��%�d�	�)�0D�E��%�d�	�%�0@�A��%�f�)�I�2F�G��%�f�)�I�2F�G�
�	
���$�$�V�,�� ��(�������'�� � ���d� �;r1c
��[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2oUOUQ	2UOUQ	P	Q
5[
U2oUOUQ2UOUQP	Q
5[
U2oUOUQ2UOUQP	Q
5[
U2oUOUQ	2UOUQ	P	Q
5P!)
z1+1
2+2
3+3
r���r��1�1r\rr;r<r[z3+3rUr\s&   r.�test_history_search�$TestPyReplOutput.test_history_searchVs/������,�-��%�f�)�G�2D�E��%�c�y���?��%�d�	�%�0@�A��%�d�	�%�0@�A�	
�
���$�$�V�,�� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;� ��(�������'�� � ���d� �;r1c���UO,2o[U]]Q5o[OQP
Q59^tt^2oUO	Q2UO	Q2UO	Q2UO
oPPP2UO
W2[U2UOUO,QN2P!)%fhKM9h[W2h9h)r)r�rBrC�wb�rNsgood
sbad
sline1
line2
)�good�badzline1
line2)
r�r(rK�NamedTemporaryFilertrM�read_history_filerr��history)r-r�rG�history_file�filenames&    r.�-test_history_file_embedded_nuls_are_sanitized�>TestPyReplOutput.test_history_file_embedded_nuls_are_sanitizedps����$�$�R�(��"�&�q��B��
�
(�
(��e�
<�
<�����y�)����z�*����4�5�#�(�(�H�	=�	��%�%�h�/��8��������)H�I�=�
<��
�8��s�AC�
C�C	�C	�
C&c��[Q2oUOU2o[U2oUOUQ2UO	UQP	Q5P!)zc
zczc^]r<)rr�rr�r>r\s&   r.�test_control_character�'TestPyReplOutput.test_control_character�sK���	�*���$�$�V�,�� ��(�������)�� � ���d� �;r1c�N�[O[Q2[Q2[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2[
U2oUOUQ2UOUQP	Q	5P!)
�
import os
�impr��page up�[5~r�r\r�	import osr<rUr\s&   r.�test_history_search_backward�-TestPyReplOutput.test_history_search_backward�s�������=�)��5�!��%�i�Y�z�5J�K��%�d�	�%�0@�A�
�
���$�$�V�,�����!��(�������-�� � ���D� �Ar1c�:�[O[Q2[QQ[	Q2Q5[QQ[	Q2Q5,2oUOU2o[
U2[
U2oUOUQ2UOUQP	Q5P!)	r�r�r�r�r�r\rr�r<rUr\s&   r.�"test_history_search_backward_empty�3TestPyReplOutput.test_history_search_backward_empty�s�������=�)��%�i�Y�z�5J�K��%�d�	�%�0@�A�
�
���$�$�V�,�����!��(�������-�� � ���D� �Ar1r�)r�r�r�r�r�r4r8r?rHrWr]r`rqrtr{r�r�r�r�r�r�r�s@r.r*r*�s[�����0�1�<�<�
!?�F<�8+�*8�v<�$<�4J� <�B�(B�Br1r*c�`�\sQsQsnQs\QP
2Q2sQsQsQs	Qs
\Q	2\Q
\OQ5Q22s
Q
sUsP!)�TestPyReplCompleter�c��[U2o[2o[OU2OUm[
V4Q5oU!�r�)rr'�rlcompleterr$�completer�r&�r-r�rdr�r�r�s&&&   r.r��"TestPyReplCompleter.prepare_reader�s<���f�%���!��$/�$9�$9�)�$D�$M�$M��!�$�W�D���
r1zrlcompleter._readline_availablec��[Q2oQ[-oUOV2o[V22oUO	UQ2P!)�os.getpid	
rd�os.getpid()�rrdr�rr��r-r�rdr�r�s&    r.�test_simple_completion�*TestPyReplCompleter.test_simple_completion�s?����0���2�J�	��$�$�V�7�� ��3�������/r1c��[Q2oQ[-oUOV2o[V22oUO	UQ2P!)zos.		O_AP	
rdzos.O_APPENDr�r�s&    r.�!test_completion_with_many_options�5TestPyReplCompleter.test_completion_with_many_options�sB�� � 1�2���2�J�	��$�$�V�7�� ��3�������/r1c�~�[Q2o-oUOV2o[V22oUOUQ2P!)z
os.geten	
zos.getenrr�s&    r.�test_empty_namespace_completion�3TestPyReplCompleter.test_empty_namespace_completion�s;����/���	��$�$�V�7�� ��3�������,r1c��[Q2oQP-oUOV2o[V22oUOUQ2P!)zpy	
�pythonrr�s&    r.� test_global_namespace_completion�4TestPyReplCompleter.test_global_namespace_completion�s@����)���t�$�	��$�$�V�7�� ��3�������*r1c��QoQ[-o[O[U2[	QQ[Q2Q5[	QQ[Q2Q5[	QQ[Q2Q5,[Q22oUO
V2Q	5o[VB2oUOUQ
2[VB2oUOUQ2P!)zimport os
os.		rdr�r�r�r�r�r�r\rcr�zos.)	rdr�r�rrr�r�rr�)r-r�rdr�r�r�s&     r.�'test_up_down_arrow_with_completion_menu�;TestPyReplCompleter.test_up_down_arrow_with_completion_menu�s���$���2�J�	�����4� ��%�f�)�I�2F�G��%�d�	�)�0D�E��%�f�)�I�2F�G�
�

�4� �
���$�$�V�$�A�� ��3�������-�!��3�������'r1z,_pyrepl.readline._ReadlineWrapper.get_readerz
sys.stderr)�new_callablec��QQ2oU2o[Q2oQU-oUOVV2oVrm[[QQ2oUOUQ2UOUO
2P2P!)c�2`�\sQsQsn\Q2sQsUsP!)�@TestPyReplCompleter.test_completion_with_warnings.<locals>.Dummy�c�4�]PHoUOQ2P!)rz	warnings
)�warnings�warn)r-r�s& r.�	test_func�JTestPyReplCompleter.test_completion_with_warnings.<locals>.Dummy.test_func�s����
�
�l�+�r1r�)r�r�r�r��propertyr�r�r�r�s@r.�Dummyr��s����
�
��
r1r�zdummy.test_func.	

�dummyz>>>z...zdummy.test_func.__)rr��return_value�readline_multiline_inputrr��getvalue)	r-�mock_stderr�mock_get_readerr�r�r�rdr�r�s	&&&      r.�test_completion_with_warnings�1TestPyReplCompleter.test_completion_with_warnings�sx��	�	����� 8�9���e�$�	��$�$�V�7��'-�$�)�*�e�U�C������!5�6�����-�-�/��4r1r�)r�r�r�r�r�r	r�r�r�r�r��io�StringIOr�r�r�r�s@r.r�r��sg������,�e�4�0�5�0�0�-�+�(�2�9�:�
�<�b�k�k�2�5�3�;�5r1r�c�:`�\sQsQsnQsQsQsQsQsUs	P!)�TestPyReplFancyCompleteric��[U2o[2o[V#Q5OUm[VEQ5oU!)��
use_colorsr�)rr'�FancyCompleterr�r�r&)r-r�rdr�r�r�r�s&&&$   r.r��'TestPyReplFancyCompleter.prepare_reader
s=���f�%���!��$2��%
�
�(�	�!�%�W�D���
r1c��[Q2oQ[-oUOVP
Q5o[V22oUO	UQ2P!)r�rdr�r�r�r�s&    r.�1test_simple_completion_preserves_callable_postfix�JTestPyReplFancyCompleter.test_simple_completion_preserves_callable_postfixsD����0���2�J�	��$�$�V�5�$�I�� ��3�������/r1c�8�QQ2oQU-oUO[Q2UP	Q5oUO[29^tt^2UO	2J)%fhL9hSOPO
SO2Q2SOSO2QO
SO2oSOQS2SOQS2SOQ	S2SOQ
S2P!)c�$�\sQsQs]s]s]sQsP!)�KTestPyReplFancyCompleter.test_attribute_menu_tracks_typed_stem.<locals>.Obji r�)r�r�r�r��apple�apricot�bananar�r�r1r.�Objr� s���E��G��Fr1r��objzobj.		ar�zobj.ar\r�r�r��mro)
r�r�assertRaises�
StopIterationrkr�rf�buffer�
assertTrue�cmpltn_menu_visible�cmpltn_menu�assertIn�assertNotIn)r-r�rdr��menus&    r.�%test_attribute_menu_tracks_typed_stem�>TestPyReplFancyCompleter.test_attribute_menu_tracks_typed_stems���	�	�
�C�L�	��$�$��;�'���%�
���
�
�}�
-�
-����� �.�
-��	
���������/��9�����2�2�3��y�y��+�+�,���
�
�g�t�$��
�
�i��&�����4�(������%s�
A�A.	�'A.	c	�N�[[Q22o[2o[QQQ]QP-P	Q5OUm[
VQ5oUOQ2vqEUOU2SOSTt,tFDo[U2MJ	to,QN2P!ttoh)	�foo_str�value�foo_int�foo_noner�r��foo_r�)r�r�r�)r�iterr'r�r�r�r&�get_completions�assertIsNoner�r )r-r�r�r��matches�action�matchs&      r.�:test_get_completions_sorts_colored_matches_by_visible_text�STestPyReplFancyCompleter.test_get_completions_sorts_colored_matches_by_visible_text8s����d�2�h�'���!��$2��7��1��D�
�
�
%
��(�	�!�%�W�D�� �0�0��8������&�!����,3�4�G�5�Z��
�G�4�.�	
��4s�B"r�)
r�r�r�r�r�r�r�r�r�r�r�s@r.r�r�s�����0�&�2
�
r1r�c�(`�\sQsQsnQsQsUsP!)�TestPyReplReadlineSetupiNc���QQ2oQQU2o[2o[2Um[2o[2o]UOm]UOm[
O[QU29^tt^2[
O[QP29^tt^2[
O[QU29^tt^2[
O[QU29^tt^2[
O[OQU29^tt^2[
O[OQ	U29^tt^2[
O[OQ
[P	Q529^tt^2[
O[OQP	Q
59^tt^2[
O[OQ29^tt^2o[QQQk29^tt^2QUm[O-2PPP2PPP2PPP2PPP2PPP2PPP2PPP2PPP2PPP2PPP2UOUOOOU2WO2P!)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)c�.`�\sQsQsnQsQsQsUsP!)�oTestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabled.<locals>.FakeFancyCompleteriPc�P�Vm[2Um[2UmP!r�)rdrr��theme)r-rds&&r.�__init__�xTestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabled.<locals>.FakeFancyCompleter.__init__Qs��!*��"&�&���!�V��
r1c��P!r�r�)r-rZ�states&&&r.r��xTestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabled.<locals>.FakeFancyCompleter.completeVs��r1)rdr�r�)r�r�r�r�r�r�r�r�r�s@r.�FakeFancyCompleterr�Ps����
$�

�
r1rc��\sQsQsQsP!)�oTestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabled.<locals>.FakeBasicCompleteriYr�)r�r�r�r�r�r�r1r.�FakeBasicCompleterrYs��r1r�_wrapper�	raw_inputr��RLCompleterrWrX�flags)�ignore_environmentr0)r��getenvzbuiltins.inputc��U!r�r�)�prompts&r.�<lambda>�eTestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabled.<locals>.<lambda>ms��fr1ry)�)rr'r�r1r�r	�object�pyrepl_readlinerard�_setup�assertIsInstancer��__self__�assert_not_called)r-rrrGrWrX�mock_getenvs&      r.�;test_setup_ignores_basic_completer_env_when_env_is_disabled�STestPyReplReadlineSetup.test_setup_ignores_basic_completer_env_when_env_is_disabledOs��	�	�	�!3�	��&��'�)���������$%����!�%&��
�
�"�
�L�L��*�g�>�>��L�L��+�t�<�<��L�L��*:�<N�O�O��L�L��-�9K�L�L��L�L��,�,�g�u�=�=��L�L��,�,�h��?�?��L�L��,�,�g�t�t�7T�U�U��L�L��+�+�X�D�I�I��L�L��+�+�X�6�6�+��"�$<�=�=�'*�K�$��"�"�2�&�
>�
7�
J�
V�
@�
>�
M�
P�
=�
?�	
����N�N�-�-�6�6��	
�	�%�%�'�
>�=��
7�6��
J�I��
V�U��
@�?��
>�=��
M�L��
P�O��
=�<��
?�>�s �
%M!�/%M	�%L;
�9/L(�(/L�9L�0K/�.K!�.K	%�J6)�$K	%�,K!�4K/�<L�L�L(�L;
�M	�$M!�6K-�?K-�K	%�	K)�K)�K!�K,%�%K,%�'K/�/K?!�8K?!�:L�L�L�
L�L%�L%� L(�(L8�1L8�3L;
�;M�M�M	�M
�M
�M!�!M1	�*M1	r�)r�r�r�r�rr�r�r�s@r.r�r�Ns����'(�'(r1r�c�`�\sQsQsnQsQsQs\O\	OQ\2-2Q2s\QQ2\Q	Q&2Q
22s
\QQ2Q
2sQsQs\QQ2Q2sQsQsQsQsQsQsQsQs\O\	O2Q2s\O\	O2Q2s\O\	O2Q2s\O\	O2Q2sQsQsQ s \O\	O2U1Q!kQ"k2s!U1Q#kQ$ks"Q%s#Us$P!)'�TestPyReplModuleCompleteriyc��[OO[O]*2o[
OUmU,[
mP!�r)rdre�dirname�	importlib�__path__ra�_saved_sys_path)r-�lib_paths& r.r/�TestPyReplModuleCompleter.setUpzs6��
�7�7�?�?�9�#5�#5�a�#8�9��"�x�x����:��r1c�2�UO[mP!r�)r!rarer,s&r.�tearDown�"TestPyReplModuleCompleter.tearDown�s���'�'��r1c��[U2o[2o[U2Um[O
U2OUm[V4Q5oU!r�)	rr'r"�module_completerr�r$r�r�r&r�s&&&   r.r��(TestPyReplModuleCompleter.prepare_reader�sI���f�%���!��"1�)�"<���$/�$9�$9�)�$D�$M�$M��!�$�W�D���
r1zimportlib.resourcesc	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�
import path	
�r�rc)
)r+zimport pathlib)zimport importlib.		res	
zimport importlib.resources)z import importlib.resources.		a	
zimport importlib.resources.abc)zimport foo, impo	
zimport foo, importlib)zimport foo as bar, impo	
zimport foo as bar, importlib)zfrom impo	
zfrom importlib)zfrom importlib.res	
�from importlib.resources)zfrom importlib.		res	
r-)zfrom importlib.resources.ab	
zfrom importlib.resources.abc)zfrom importlib import mac	
zfrom importlib import machinery)zfrom importlib import res	
zfrom importlib import resources)zfrom importlib.res	 import a	
z#from importlib.resources import abc)zfrom __phello__ import s	
zfrom __phello__ import spam��subTestrr��readliner��r-�casesr�rVr�r�r�s&      r.�test_completions�*TestPyReplModuleCompleter.test_completions�ss��
��$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(���AA4	�4B
�=B
zpkgutil.iter_modulesc�8�[PQP	2[PQP	2,!�N�public�_privaterr�r1r.r�"TestPyReplModuleCompleter.<lambda>�s��J�t�X�t�,L�,6�t�Z��,N�,Pr1zsys.builtin_module_namesc	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�	import 	
r,rc))r<z
import public)zfrom 	
zfrom public)z
import _	
zimport _private)zfrom _	
z
from _privater.r1s&      r.�test_private_completions�2TestPyReplModuleCompleter.test_private_completions�ss��
��$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5z9_pyrepl._module_completer.ModuleCompleter.iter_submodulesc�8�[PQP	2[PQP	2,!r7r)r�s*r.rr:�s���t�X�t�,��t�Z��.�
r1c	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�from foo import 	
r,rc))rAzfrom foo import public)zfrom foo import _p	
zfrom foo import _privater.r1s&      r.�#test_sub_module_private_completions�=TestPyReplModuleCompleter.test_sub_module_private_completions�ss��
��$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5c	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�import bui	
r,rc))rEzimport builtins)z
from bui	
z
from builtinsr.r1s&      r.�!test_builtin_completion_top_level�;TestPyReplModuleCompleter.test_builtin_completion_top_level�ss��
��$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5c	��QoSFDjvq#oUOUQ59^tt^2[U2oUOUQU-Q5oUO2oUO	Vt2PPP2Jl	P!)%fhJ�9h)Nr,�__package__rc))N�
from .readl	
zfrom .readl)N�from . import readl	
zfrom . import readl)�_pyreplrJzfrom .readline)rLrKzfrom . import readline)rLzfrom .readline import mul	
z%from .readline import multiline_input)rLzfrom .. import toodeep	
zfrom .. import toodeep)�
concurrentzfrom .futures.i	
zfrom .futures.interpreterr.)r-r2�packager�rVr�r�r�s&       r.�test_relative_completions�3TestPyReplModuleCompleter.test_relative_completions�s{��
��(-�#�G�8����4��(�(�'��-���,�,�V�
�w�?W�,�X�����*��� � ��2�	)�(�(-�(�(�(�s�AA7	�7B
�B
c�8�[PQP	2[PQP	2,!)N�
valid_namezinvalid-namerr�r1r.rr:�s��J�t�\�4�,P�,6�t�^�T�,R�,Tr1c	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�import valid	
r,rc))rTzimport valid_name)zimport invalid	
zimport invalidr.r1s&      r.�test_invalid_identifiers�2TestPyReplModuleCompleter.test_invalid_identifiers�ss��

��
$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5c	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�import pri	
r,rc))rXz
import pri)z
from pri	
zfrom pri)zfrom typong import Na	
zfrom typong import Nar.r1s&      r.�&test_no_fallback_on_regular_completion�@TestPyReplModuleCompleter.test_no_fallback_on_regular_completion�ss��
��
$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5c	�h�[O29^tt^2o[O[QU,[O
N29^tt^2[OU2oUQ*O2UQ*O2[Q2oUOU-Q5oUO2UO2qeUOUQ2UOUQ2PPP2PPP2P!)%fhK9h)%fhP!9h)rez	mod_aa.pyz	mod_bb.pyzimport mod_a	
import mod_b	
rcz
import mod_aaz
import mod_bb)
rKrLr	rrare�pathlib�Path�touchrr�r0r�)r-�_dir1�dir1r�r��output_1�output_2s&      r.�test_global_cache�+TestPyReplModuleCompleter.test_global_cache
s����)�)�+�+�u��l�l�3���(:����(:�;�;��<�<��&�D�
�K�
�&�&�(�
�K�
�&�&�(�#�$F�G�F��(�(��2�(�>�F�!'���!2�F�O�O�4E�h����X��7����X��7�<�,�+�;�;��,�+�+�s0�6D �B&D
	�;D �
D
�D
�D � D1	�)D1	c	��QoSFDgvq#UOUQ59^tt^2[U2oUOU-Q5oUO2oUO	Vc2PPP2Ji	P!)%fhJ~9h)�import collections.	
r,rc))rf�import collections.abc)zimport os.	
zimport os.path)zimport math.	
zimport math.integer)zimport xml.parsers.expat.		e	

zimport xml.parsers.expat.errors)z$from xml.parsers.expat import 		m	

z#from xml.parsers.expat import modelr.r1s&      r.� test_hardcoded_stdlib_submodules�:TestPyReplModuleCompleter.test_hardcoded_stdlib_submodulesss��
��$�N�D����4��(�(�'��-���,�,�V�r�,�B�����*��� � ��2�	)�(�$�(�(�(�r5c���[O29^tt^2o[O[Q-29^tt^2[
OU2oUQ*O2UQ*Q*O2UQ*Q*O2[O[QU,[ON29^tt^2[Q2oUOU-Q5oUO2oUOUQ2PPP2PPP2PPP2P!)%fhK"9h)%fhK-9h)%fhP!9h)�modules�collections�__init__.py�foo.pyrerfrczimport collections.foo)rKrLr	rrar\r]�mkdirr^rerr�r0r��r-�_dir�dirr�r�r�s&     r.�=test_hardcoded_stdlib_submodules_not_proposed_if_local_import�WTestPyReplModuleCompleter.test_hardcoded_stdlib_submodules_not_proposed_if_local_import%s����)�)�+�+�t��l�l�3�	�2�.�.��,�,�t�$�C�
�=�
 �'�'�)�
�=�
 �=�
0�7�7�9�
�=�
 �8�
+�2�2�4����c�6�D�+<�3�8�8�+<�=�=�'�(A�B���,�,�V�r�,�B�����*��� � ��)A�B�	>�/�,�+�>�=��/�.��,�+�+�sO�%E$�BE	�#AD>
�$E	�,E$�>E�E�	E	�E!
�E!
�E$�$E5	�-E5	c	�p�[O29^tt^2o[O[QU,[O
N29^tt^2[OU2oUQ*O2UQ*Q*O2UQ*Q*O2[Q2oUOU-Q5oUO2oUOUQ2PPP2PPP2P!)%fhK9h)%fhP!9h)rerlrmrnrfrcrg)rKrLr	rrarer\r]ror^rr�r0r�rps&     r.�8test_already_imported_stdlib_module_no_other_suggestions�RTestPyReplModuleCompleter.test_already_imported_stdlib_module_no_other_suggestions2s����)�)�+�+�t��l�l�3���(9����(9�:�:��,�,�t�$�C�
�=�
 �'�'�)�
�=�
 �=�
0�7�7�9�
�=�
 �8�
+�2�2�4�$�$=�>�F��(�(��2�(�>�F��_�_�&�F����V�%=�>�;�,�+�:�:��,�+�+�s0�6D$�B*D	�?D$�D!
�D!
�D$�$D5	�-D5	c���[O29^tt^2o[O29^tt^2o[O[QV!,[O
N29^tt^2[OU2oUQ*O2UQ*Q*O2UQ*Q*O2[OQ2[OU2oUQ*O2UQ*Q*O2UQ*Q*O2[OU2O2[Q2oUO!U-Q5oUO#2oUO%UQ2[O&Q[Q2oUO!U-Q5oUO#2oUO%UQ2PPP2PPP2PPP2P!)%fhK"9h)%fhK-9h)%fhP!9h)	re�mymodulermrn�bar.py�import mymodule.	
rc�import mymodule.zimport mymodule.bar)rKrLr	rrarer\r]ror^rr�pkgutil�get_importer�invalidate_cachesrr�r0r�rk�r-r_�_dir2r`�dir2r�r�r�s&       r.�2test_already_imported_custom_module_no_suggestions�LTestPyReplModuleCompleter.test_already_imported_custom_module_no_suggestionsAs����)�)�+�+�u��)�)�+�+�u��l�l�3���(A����(A�B�B��<�<��&�D�
�J�
�%�%�'�
�J�
��
.�5�5�7�
�J�
��
)�0�0�2��#�#�J�/��<�<��&�D�
�J�
�%�%�'�
�J�
��
.�5�5�7�
�J�
��
)�0�0�2�� � ��'�9�9�;�$�$:�;�F��(�(��2�(�>�F��_�_�&�F����V�%7�8����J�'�#�$:�;�F��(�(��2�(�>�F��_�_�&�F����V�%:�;�3C�,�,�+�B�B��,�+��,�+�+�sM�I�6H>	�3FH+
�H>	�I�+H;�4H;�6H>	�>I
�I
�	I�I"	�I"	c��[O29^tt^2o[O29^tt^2o[O[QV!,[O
N29^tt^2[OU2oUQ*O2UQ*O2[OQ2[OU2oUQ*O2UQ*Q*O2UQ*Q*O2[Q2oUOU-Q5oUO2oUOUQ2[O QPPP2PPP2PPP2P!)%fhK"9h)%fhK-9h)%fhP!9h)reryzmymodule.pyrmrzr{rcr|)rKrLr	rrarer\r]ror^rrrr�r0r�rkr�s&       r.�0test_already_imported_custom_file_no_suggestions�JTestPyReplModuleCompleter.test_already_imported_custom_file_no_suggestions_sF���)�)�+�+�u��)�)�+�+�u��l�l�3���(A����(A�B�B��<�<��&�D�
�J�
�%�%�'�
�M�
!�(�(�*��#�#�J�/��<�<��&�D�
�J�
�%�%�'�
�J�
��
.�5�5�7�
�J�
��
)�0�0�2�#�$:�;�F��(�(��2�(�>�F��_�_�&�F����V�%7�8����J�'�C�,�,�+�B�B��,�+��,�+�+�sM�G�6F5	�3DF"
�F5	�G�"F2�+F2�-F5	�5G
�>G
�G�G	�G	c��[O29^tt^2o[O[QU,[O
N29^tt^2[OU2oQ	FCD oV#*O2V#*Q*O2V#*Q*O2[OU2O2[OU2oUQ6XcPUOmL UQ6XcP
UOmLPUm[%QUQ02oUO'U-Q5oUO)2oUO+UQUQ02[O,UCJ#	PPP2PPP2P!)%fhK9h)%fhP!9h)
re�	no_origin�not_has_locationrmrn�import z.	
rc�.)r�r��no_spec)rKrLr	rrarer\r]ror^r}r~rrr�__spec__�origin�has_locationrr�r0r�rk)r-r_r`�mod�moduler�r�r�s&       r.�3test_already_imported_module_without_origin_or_spec�MTestPyReplModuleCompleter.test_already_imported_module_without_origin_or_spectsO���)�)�+�+�u��l�l�3���(:����(:�;�;��<�<��&�D�C����"�"�$���m�+�2�2�4���h�&�-�-�/��$�$�U�+�=�=�?�"�0�0��5���+�%�-1�F�O�O�*��.�.�38�F�O�O�0�&*�F�O�'�'�#��e�(<�=���,�,�V�r�,�B�����*��� � ��7�3�%�q�)9�:��K�K��$�#D�<�,�+�;�;��,�+�+�s=�6F9�B.F&	�F&	�A7F&	�F9�&F6
�/F6
�1F9�9G
	�G
	c��[O29^tt^2o[OU2oUQ*O	Q2UQ*O	Q2UQ*O2UQ*Q*O	Q2UQ*Q*O
2UQ*Q*O
2UQ*Q*O
2[OOQP2[OOQ	P2[OOQ
P2[O[QU,[ON29^tt^2[OU2O2[ O"Q2Q
Q[%21QQQ.1QQ[%21QQQ.1QQ[%21QQ[%21QQQ.1QQQ.1QQ[%21QQQ.1QQ[%21Q Q[%21Q!QQ.1Q"Q#[%21Q$Q%Q.1Q&Q'[%21Q(Q)[%211oSFD�vqEoUO'UQ*59^tt^2[O([O29^tt^2[%[OO+22o[-U2oUO/U-Q+5o	U	O12o
UO3V�2[OO+2U*
oUO3V�2PPP2PPP2J�	PPP2PPP2P!)%fhK.9h)%fhCJ59h)%fhKB9h)%fhP!9h),rn�bar = 42rzzbaz = 42�packrmz	attr = 42zbaz.py�graphlib�antigravityzunittest.__main__re�barrA�from foo import �from foo import 		
�from foo import bar�foozfrom foo import ba	
�from foo import bazfrom foo import ba		
zfrom foo import 	b	a	
zfrom pack import 		
�from pack import zfrom pack import 			
zfrom pack import 			a	
zfrom pack import attrzfrom pack import f	
zfrom pack import foozfrom pack import f		
zfrom pack import b	
zfrom pack import bazfrom pack import b		
zfrom pack import b			
zfrom bar import b	
zfrom bar import bazzfrom graphlib import T	
z&from graphlib import TopologicalSorterzfrom antigravity import g	
zfrom antigravity import gz from unittest.__main__ import 	
zfrom unittest.__main__ import r,rc)rKrLr\r]�
write_textror^rark�popr	rrer}r~rrr�setr/r@�keysrr�r0r�)r-rqrrr2r�rV�expected_imports�	_importedr�r�r��new_importss&           r.�test_attribute_completion�3TestPyReplModuleCompleter.test_attribute_completion�s���
�
(�
(�
*�
*�d��,�,�t�$�C�
�8�^�'�'�
�3�
�8�^�'�'�
�3�
�6�\� � �"�
�6�\�M�
)�5�5�k�B�
�6�\�H�
$�+�+�-�
�6�\�H�
$�+�+�-�
�6�\�H�
$�+�+�-��K�K�O�O�J��-��K�K�O�O�M�4�0��K�K�O�O�/��6����c�6�D�+<�3�8�8�+<�=�=��$�$�T�*�<�<�>��'�'��.�,�-?���G�-�/D�u�g�N�-�/C�S�U�K�/�1F���P�1�3G���O�.�0C�S�U�K�0�2E��x�P�3�5L�v�h�W�-�/E�s�u�M�/�1G�&��R�-�/D�c�e�L�/�1F���N�1�3H�6�(�S�,�.C�S�U�K�1�3[�^h�]i�j�4�6Q�SV�SX�Y�9�;[�]`�]b�c�3��69>�4�D�$4����4��0�0�%�*�*�S�[�[�2I�2I�$'����(8�(8�(:�$;�	�!/��!5��!%�!4�!4�V�r�!4�!J��!'���!2���(�(��:�&)�k�k�&6�&6�&8�9�&D���(�(��G�3J�0�0�9>�=>�+�
*�V3J�2I��0�0�0��?>�=��+�
*�
*�sn�E,N1�C;N	�-N	�3BM6�N	�N	�$N1�6N�?N�N	�	N�N�
N	�N.
�'N.
�)N1�1O	�:O	c
���[O29^tt^2o[OU2oUQ*O	Q2UQ*O	Q2[
O[QU,[ON29^tt^2QoSFDgvqEUOUQ59^tt^2[U2oUOU-Q5oUO2oUOV�2PPP2Ji	UOQ[O2PPP2PPP2P!)%fhJ�9h)%fhK.9h)%fhP!9h)	rnr��boom.pyz1 <> 2rer,rc�boom))�from boom import 		
�from boom import )r�r�)rKrLr\r]r�r	rrarer/rr�r0r�r�rk)	r-rqrrr2r�rVr�r�r�s	&        r.�)test_attribute_completion_error_on_import�CTestPyReplModuleCompleter.test_attribute_completion_error_on_import�s��
�
(�
(�
*�
*�d��,�,�t�$�C�
�8�^�'�'�
�3�
�9�_�(�(��2����c�6�D�+<�3�8�8�+<�=�=���',�N�D����4��0�0�!/��!5��!%�!4�!4�V�r�!4�!J��!'���!2���(�(��:�	1�0�',�� � �����5�>�	+�
*�1�0�0��
>�=��	+�
*�
*�sO�A<E%�%E	�AD>�,E	�,E%�>E�E�		E	�E"
�E"
�E%�%E6	�.E6	c	��[O29^tt^2o[OU2oUQ*O	2UQ*Q*OQ2UQ*Q*O
2[O[QU,[ON29^tt^2[Q2oUOU-Q5oUO2oUOQ[O2UO!UQ2PPP2PPP2P!)%fhK9h)%fhP!9h)r�rmz!def __dir__(): raise ValueError()zsubmodule.pyrer�rczfrom boom import submodule)rKrLr\r]ror�r^r	rrarerr�r0r�rkr�rps&     r.�4test_attribute_completion_error_on_attributes_access�NTestPyReplModuleCompleter.test_attribute_completion_error_on_attributes_access�s���
�
(�
(�
*�
*�d��,�,�t�$�C�
�6�\� � �"�
�6�\�-�
'�3�3�4W�X�
�6�\�.�
(�/�/�1����c�6�D�+<�3�8�8�+<�=�=�'�(A�B���,�,�V�r�,�B�����*���
�
�f�c�k�k�2�� � ��)E�F�
>�+�
*�
>�=��+�
*�
*�s1�B E�?A!D2	� E�2E
�;E
�=E�E	�E	c
���[O29^tt^2o[OU2oUQ*O	Q2[
O[QU,[ON29^tt^2[OQ2oQUOQ$QoSFDgvqVUOUQ59^tt^2[U2oUOU-Q5oUO2o	UO!V�2PPP2Ji	PPP2PPP2P!)%fhJ�9h)%fhK.9h)%fhP!9h)	rnz_secret = 'bar'rer��bazzinvalid-identifierr,rc))rAr�)zfrom foo import _s	
zfrom foo import _secret)zfrom foo import inv	
zfrom foo import inv)rKrLr\r]r�r	rrarerr�__dict__r/rr�r0r�)
r-rqrrr�r2r�rVr�r�r�s
&         r.�3test_attribute_completion_private_and_invalid_names�MTestPyReplModuleCompleter.test_attribute_completion_private_and_invalid_names�s��
�
(�
(�
*�
*�d��,�,�t�$�C�
�8�^�'�'�(9�:����c�6�D�+<�3�8�8�+<�=�=��-�-�e�4��5:����1�2���
',�N�D����4��0�0�!/��!5��!%�!4�!4�V�r�!4�!J��!'���!2���(�(��:�	1�0�',�>�+�
*�1�0�0��>�=��+�
*�
*�sP�A$E�A
D?	�
AD+�
D?	�E�+D<�4D<�6	D?	�?E
�E
�
E�E#	�E#	c	���Qo[2oSFDIvq4UOUQ59^tt^2UOUOU2U2PPP2JK	P!)%fhJ`9h)r)rM))r)rr)r�)r�r)�..)r�r)�.foo)r�r�)�..foo)r�r�)z..foo.)r�r)�	..foo.bar)r�r�)z	.foo.bar.)z.foo.barr)z
..foo.bar.)r�r)r�)rr�)zfoo.�r�r)�foo.bar)r�r�)zfoo.bar.)r�r)zfoo.bar.baz)r�r�)r"r/r��get_path_and_prefix)r-r2�	completerrMrVs&    r.�test_get_path_and_prefix�2TestPyReplModuleCompleter.test_get_path_and_prefix�s]��
�� $�%�	�#�N�D����4��(�(�� � ��!>�!>�t�!D�h�O�)�(�$�(�(�(�s�"A 	� A1
�)A1
c	��QoSFD�vq#[U2oUO2oUOUQ59^tt^2UOVS2PPP2QU0o[U2oUO2oUOUQ59^tt^2UOVS2PPP2QU0o[U2oUO2oUOUQ59^tt^2UOVS2PPP2J�	P!)%fhK�9h)%fhK}9h)%fhCJ:9h)r�r,zimport xyz
zimport xyz;)#)r��Nr)z
import foo�Nr�)zimport foo,r�)zimport foo, r�)zimport foo, bar)Nr�)zimport foo, bar, baz�Nr�)zimport foo as bar,r�)zimport foo as bar, r�)zimport foo as bar, bazr�)z	import a.)N�a.)z
import a.b)N�a.b)zimport a.b.)N�a.b.)zimport a.b.c)N�a.b.c)zimport a.b.c, foor�)zimport a.b.c, foo.bar)Nr�)zimport a.b.c, foo.bar,r�)zimport a.b.c, foo.bar, r�)zfrom foo)r�N)zfrom a.)r�N)zfrom a.b)r�N)z	from a.b.)r�N)z
from a.b.c)r�N)r�r�)zfrom foo import a�r�rQ)zfrom )rN)zfrom . import a)r�rQ)zfrom .foo import a)r�rQ)zfrom ..foo import a)r�rQ)zfrom foo import (r�)zfrom foo import ( r�)zfrom foo import (ar�)zfrom foo import (a,r�)zfrom foo import (a, r�)zfrom foo import (a, c�r��c)zfrom foo import (a as b, cr��r!�parser/r�)r-r2r��parsed�parser�actual�_codes&      r.�
test_parse�$TestPyReplModuleCompleter.test_parses���$
��J"�L�D�!�$�'�F��\�\�^�F����4��(�(�� � ��0�)�#�4�&�)�E�!�%�(�F��\�\�^�F����5��)�)�� � ��0�*�!�$��(�E�!�%�(�F��\�\�^�F����5��)�)�� � ��0�*�)�"�)�(��*�)��
*�)�)�s6�D		�D	�)D/	�	D
�D
�D,
�%D,
�/E
�8E
c	���QoSFDSo[U2oUO2oUOUQ59^tt^2UOUP2PPP2JU	P!)%fhJj9h)rr,),rzimport foo �	from foo zimport foo. zimport foo.bar r�z
from foo. z
from foo.bar zfrom foo import bar zfrom foo import (bar zfrom foo import bar, baz z
import foo aszimport a. asz
import a.b aszimport a.b. aszimport a.b.c aszimport (foozimport (zimport .foozimport ..foozimport .foo.barzimport foo; x = 1zimport foo; 1,zimport a.; x = 1zimport a.b; x = 1zimport a.b.; x = 1zimport a.b.c; x = 1zfrom foo import a aszfrom foo import a. aszfrom foo import a.b aszfrom foo import a.b. aszfrom foo import a.b.c asz
from foo impoz
import importzimport fromz	import aszfrom importz	from fromzfrom aszfrom foo import importzfrom foo import fromzfrom foo import aszfrom \xzif 1:
 pass
	passr�)r-r2r�r�r�s&    r.�test_parse_error�*TestPyReplModuleCompleter.test_parse_errorFs`��-
��\�D�!�$�'�F��\�\�^�F����4��(�(�� � ���.�)�(��)�(�(�s�A 	� A1
�)A1
c� :�U]6�cPgQP-!�r9r<r�)rErFs"�r.rG�DTestPyReplModuleCompleter.test_suggestions_and_messages.__annotate__|s���=K�=K�t�=Kr1c��QoQo[O29^tt^2o[OU2oUQ*O	Q2UQ*O	Q2UQ*O2UQ*Q*O	Q2UQ*Q	*O
2[OOQ
P2[OOQP2[O[QU,[ON29^tt^2[OU2O2Q
,P1[!21QP[!21QQQ,P1[!21QQ,P1[!21Q,UP11Q.1QQ,P1[!21QQ,P1[!21Q,V11[!21Q,P1[!21QQ,P1[!21QQ,UP11Q.1QQQ,P1[!21Q,UP11Q.1Q,P1[!21QQ,P1Q
.1QQ ,P1Q.11o[#2o[%U2FCDHvovq�o
UO'V�Q!59^tt^2[![OO)22oUO+U2oUO-UPIU	PI2U%c�Uvq�oUO-V�]*2UO-UPIU	]*PI2U%cMUvooUO-UU	]*]*2U2oUO-UU	]*]*2[OO)2U*
oUO/UU
2PPP2CJK	PPP2PPP2P!)%fhCJq9h)%fhK/9h)%fhP!9h)"zH[ module not imported, press again to import it and propose attributes ]z)[ error during import: division by zero ]rnr�r�z1/0r�rmzfoo = 1; bar = 2;rzr�zstring.templatelibrezimport nopezimprot nopez
import colrl�colorsysz	import for�r�r�r�r�zfrom collections import a�abcr�zfrom pack.bar import zpack.barzfrom graphlib import T�TopologicalSorterz from string.templatelib import c�convert)r��i)rKrLr\r]r�ror^rarkr�r	rrer}r~rr�r"�	enumerater/r�r�r��assertSetEqual)r-�_prompt�_errorrqrrr2r�r�r�rVr�r��result�compl�_values�act�msg�func�
act_resultr�s&                   r.�test_suggestions_and_messages�7TestPyReplModuleCompleter.test_suggestions_and_messages{sw��.��<��
�
(�
(�
*�
*�d��,�,�t�$�C�
�8�^�'�'�
�3�
�9�_�(�(��/�
�6�\� � �"�
�6�\�M�
)�5�5�6I�J�
�6�\�H�
$�+�+�-��K�K�O�O�J��-��K�K�O�O�0�$�7����c�6�D�+<�3�8�8�+<�=�=��$�$�T�*�<�<�>�#�R��J���6�"�D�#�%�0�!�]�J�$?��#F���N� �E�7�D�/�3�5�9�'�"�w��o�)>���H�'�5�'�4��#�%�@�)�U�G�T�?�C�E�B�(�2��/@�*A�3�5�I�(�2�t�*�c�e�<�0�E�7�D�/�3�5�I�(�E�7�W�d�O�*D�v�h�O�(�E�5�>�4�*@�#�%�H�,�r�G�T�?�.C�j�\�R�,�r�4�j�#�%�@�-�1D�0E�t�/L�z�l�[�7�9�+�t�9L�Oc�Nd�e�-��0,�-�	�=F�u�=M�=M�9�A�9��(8����4��5�5�$'����(8�(8�(:�$;�	�!*�!:�!:�4�!@���(�(��4���T�9I�J�!�28�/�E�C� �,�,�U�Q�K�@� �,�,�S�D�[�(�1�+��:M�N�"�,/�	��T� $� 0� 0��h�q�k�!�n� E�-1�V�
� $� 0� 0��X�a�[��^� L�&)�k�k�&6�&6�&8�9�&D���+�+�K�9I�J�6�5�>N�=>�+�
*�P6�5�5��?>�=��+�
*�
*�s^�DO�3D.N1	�!AN�8AN�:BN�=
N1	�
O�N.�%N.�'
N1	�1O
�:O
�<O�O	�
O	c� :�U]6�cPgQP-!r�r�)rErFs"�r.rG�GTestPyReplModuleCompleter.test_colorize_import_completions.__annotate__�s���*"�*"�$�*"r1c�j`	�[2n	R	OOoR	OOo[O
oU	1Qko[
UQ5o[[,Q5UQ5o[Q2Um
[UO2UmUO2vqxUOUUQU0UQU0,2UOU2[Q2Um
[UO2UmUO2vqxUOUUQU0UQ	U0,2UOU2[Q
2Um
[UO2UmUO2vqxUOUUQU0UQU0,2UOU2P!)
c�:�[VR2!r�)r%)�names�valuesr�s&&�r.r�LTestPyReplModuleCompleter.test_colorize_import_completions.<locals>.<lambda>�s
���)9�%��)Or1)�colorize_completions)r�r�zfrom collections import de�defaultdict�dequezfrom importlib.mzimportlib.machineryzimportlib.metadatazfrom unittest import m�main�mock)r�fancycompleterrEr�r�RESETr'r&rr?r�r�r��get_module_completionsr�r�)
r-�
type_color�module_color�R�colorizer�r�r�r�r�s
&        @r.� test_colorize_import_completions�:TestPyReplModuleCompleter.test_colorize_import_completions�s��������)�)�.�.�
��+�+�2�2������O���X�>��$��r�*��
���9�:��
�����'��
��5�5�7�
�������l�+�a�S�)��l�%��s�#�!
�	�	
���&�!��/�0��
�����'��
��5�5�7�
�������n�/��s�3��n�.�q�c�2�!
�	�	
���&�!��5�6��
�����'��
��5�5�7�
�������l�$�q�c�"��n�D���$�!
�	�	
���&�!r1)r!r�)%r�r�r�r�r/r%r�r	r@rarkrr3r=rBrFrOrUrYrcrhrsrvr�r�r�r�r�r�r�r�r�r�r�rr�r�r�s@r.rrys������(���Z�Z����&���1�3�3�3�3�.�!�$P�Q�
�%�r�*�3�+�Q�3� �C�	
��3��3�
3�3�"�!�$T�U�
3�U�
3�3�
8�
3�C�
?�<�<(�*%�.�Z�Z�����3H��3H�j�Z�Z�����6��6�$�Z�Z�����G��G��Z�Z�����;��;�(P�,61�p3/�j�Z�Z�����=K��=K�~*"�*"r1rc�2�U]6�cPgQ[Q[-!)r9rM�_args)r>rC)rEs"r.rG�_hook.__annotate__�s�� � �� �E� r1c�F�[d[OU2P!P!r�)�
_audit_events�add)rMrs&&r.�_hookr�s��� ����$��!r1c#�J �[2r[w�PrP!Prh9h3hr�)r�r
r�r1r.�_capture_audit_eventsr�s#����E�M�����
���
�s�#�	�#� �#c�(`�\sQsQsnQsQsUsP!)�#TestModuleCompleterAutomaticImportsi�c�
�]QHGo[2oU2OUOP2FCDVvq4UOUQ59^tt^2[
29^tt^2o[29^tt^2o[29^tt^2o[%c[Q2L[O29^tt^2o[OQQ59^tt^2UOU2PPP2PPP2PPP2PPP2PPP2UO!WO#2P2UO!WO#2P2UO%QW2WdUO'2PPP2CJY	P!)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhCJ�9h)r)�AllTest)�modnameztkinter._tkinter.create�ignore)r�zsubprocess.Popen)�test.test___all__rr"�walk_modules�_stdlib_pathr/r
rr�tkinterr	�
contextlib�nullcontextr��catch_warnings�_maybe_import_moduler�r�r�r)	r-rr�r�r�out�err�audit_events�tk_mocks	&        r.�test_no_side_effects�8TestModuleCompleterAutomaticImports.test_no_side_effects�sV��-�#�%�	�!�)�0�0��1G�1G��L�L�J�A����g��.�.�%�'�'�3�%�'�'�3�+�-�-��;B�7�u�6�7�&�2�2�4�5�5�9@��-�-�X�>�>��2�2�7�;�?�5�.�(�(�� � ������4�� � ������4�� � �!3�\�B��&��-�-�/�!/�.�M�?�>��5�5��.�-��(�'��(�'��/�.�.�s��G0	�'G
�:G
�
F7�(F7� F$�"F�4F$�<F7�G
�G
�AG0	�2G0	�F!!�F!!�F$�$F4�-F4�/F7�7G�G�G
�
G�G�G
�G-�&G-�(G0	�0H
�9H
r�)r�r�r�r�r!r�r�r�s@r.rr�s����0�0r1rc�f`�\sQsQsn\O
\O2Q2sQs	Us
P!)�TestHardcodedSubmodulesic��[O2FDOvqSFDCoUQU0oUOUQ59^tt^2[OU2PPP2JE	JQ	P!)%fhJ^9h)r�)re)r#�itemsr/rr)r-�parent_path�
submodules�module_nameres&    r.�/test_hardcoded_stdlib_submodules_are_importable�GTestHardcodedSubmodules.test_hardcoded_stdlib_submodules_are_importablesh��';�'A�'A�'C�#�K�)��%��a��}�5���\�\�t�\�,�,��+�+�D�1�	-�,� *�(D�-�,�,�s�A-
�-A>�6A>r�)r�r�r�r�r	r@rarkr*r�r�r�s@r.r$r$s$����
�Z�Z�����2��2r1r$c�L`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�TestPasteEventi#c�N�[U2o[PQ5o[V#Q5oU!r�r�r�s&&   r.r��TestPasteEvent.prepare_reader$r�r1c��Qo[O[QQ[Q2Q5,[	U2[QQ[Q2Q5,[	Q22oUOU2o[
U2oUOVA2P!)zOdef a():
  for x in range(10):
    if x%2:
      print(x)
    else:
      pass
r��f3�ORr�r\�r�r�rr�rr�rr��r-r�r�r�r�s&    r.�
test_paste�TestPasteEvent.test_paste*s���
�	
�����%�d�	�)�0D�E�
�
�4� ��%�d�	�)�0D�E�
�
�4� �	
���$�$�V�,�� ��(������&r1c��Qo[O[QQ[Q2Q5,[	U2[QQ[Q2Q5,[	Q22oUOU2o[
U2oUOVA2P!)zdef f():
  x = y
  
  y = z
r�r1r2r�r\r3r4s&    r.�test_paste_mid_newlines�&TestPasteEvent.test_paste_mid_newlinesDs���
�	
�����%�d�	�)�0D�E�
�
�4� ��%�d�	�)�0D�E�
�
�4� �	
���$�$�V�,�� ��(������&r1c��QoQo[U2oUOU2o[U2oUOVR2P!)zdef f():
x = y

y = z

zdef f():
    x = y
    r)r-r�rVr�r�r�s&     r.�)test_paste_mid_newlines_not_in_paste_mode�8TestPasteEvent.test_paste_mid_newlines_not_in_paste_mode\sJ��
�	
�
�	� ��%���$�$�V�,�� ��(������*r1c��QoQo[U2oUOU2o[U2oUOVR2P!)z:def a():
for x in range(10):
if x%2:
print(x)
else:
pass

zWdef a():
    for x in range(10):
        if x%2:
            print(x)
            else:rrs&     r.�test_paste_not_in_paste_mode�+TestPasteEvent.test_paste_not_in_paste_modeqsJ��
#�	�
 �	� �
�+���$�$�V�,�� ��(������-r1c���QoQoQoQo[O[U2[U2[U2[Q22oUOU2o[	U2oUOVr2P!)zQdef a():
  for x in range(10):

    if x%2:
      print(x)

    else:
      pass
�[200~�[201~r\�r�r�rr�rr�)r-rr�paste_start�	paste_endr�r�r�s&       r.�test_bracketed_paste�#TestPasteEvent.test_bracketed_paste�sz��
�	�
�	�"���	�����;�'��:�&��9�%��4� �	
���$�$�V�,�� ��(������-r1c���QoQoQo[O[U2[U2[U2[Q22oUOU2o[	U2oUOVa2P!)�onelinerArBr\rC)r-rrDrEr�r�r�s&      r.� test_bracketed_paste_single_line�/TestPasteEvent.test_bracketed_paste_single_line�si���
�!���	�����;�'��:�&��9�%��4� �	
���$�$�V�,�� ��(������,r1r�)
r�r�r�r�r�r5r8r;r>rFrJr�r�r�s@r.r-r-#s.�����'�4'�0+�*.�2%.�N-�-r1r-zrequires ptyc�(`�\sQsQsnQsQsUsP!)�TestDumbTerminali�c�l�[OO2oUOQP2UOQP2UO	QQ-2UOQUQ5vq#UO
U]2UOQU2UOQU2UOQU2P!)	�PYTHON_BASIC_REPL�
PYTHONSTARTUP�TERM�dumbzexit()
�r;zwarning: can't use pyrepl�	Exception�	Traceback)	rdrq�copyr��updaterQr�r�r�)r-r;r�r�s&   r.� test_dumb_terminal_exits_cleanly�1TestDumbTerminal.test_dumb_terminal_exits_cleanly�s����j�j�o�o������#�T�*�	�����&��
�
�F�F�#�$� �M�M�*�#�M�>�������A�&��
�
�1�6�:�����f�-�����f�-r1r�)r�r�r�r�rXr�r�r�s@r.rMrM�s����.�.r1rMc��`�[OP2n[9PIcU1QkQ2D%cJP
!	P	!U1QkQ22![cP
!h9h)Nc3�V:�SF �DoROU2PIw�	J	P!3hr�)�get)�.0�cap�infos& �r.�	<genexpr>�"supports_pyrepl.<locals>.<genexpr>�s#��7���7�3��x�x��}�D�(�7�s�!))�bel�clear�cup�el)r�TermInforT�all)r_s@r.�supports_pyreplrh�si����� � ��&���3�9�7�9�3�3�9�3�9�3�9�7�9�9�9������s�A�	A"�A"�!A"z!can't use pyrepl in this terminalc�X``�\sQsQsnU1Qks\Q2sU1QkQks\QP
QP
QP
-Q	k2sQ
s	Qs
QsQ
sQs
Qs\Q2s\Q2sQs\Q2sQs\Q2s\Q2sQs\Q2sQsQsQsQs\\Q2Q2sQs\Q 2s Q!s!Us"U9s#!)"�TestMaini�c�:�[RU_2[Q[2Q5oUO	UO
2UO
2P!)z
os.environ)�new)�superr/r	r
�
addCleanup�stop�start)r-�patcher�	__class__s& �r.r/�TestMain.setUp�s6���	��
����.�*:�;��������%��
�
�r1c��QoQoUOQQ,P	Q5vq4UOU]2UQU0U7oUQU0U7oUQU0U7oUQU0U7oSOS9%fS9%f
S9%fSU2P!)z['__builtins__'z4'__loader__', '__name__', '__package__', '__spec__']z
sorted(dir())�exit())r4z
, '__doc__', z, '__doc__', '__file__', )rQr�r�)	r-�pre�postr�r��case1�case2�case3�case4s	&        r.�test_exposed_globals_in_repl�%TestMain.test_exposed_globals_in_repl�s�����E�� �M�M�?�H�*E�D�M�Q�������A�&��%�}�T�F�+�v�5���%�0���7�6�A���%�0���7�6�A���%�}�T�F�+�v�5������8�8��8�8�%�8�8�5�&�Ar1c�V:�U]6�cPgQRZQRZRZO*QRZQP-!)r9�varrVr�r<)r>�re�Pattern)rErFs"�r.rG�$TestMain._assertMatchOK.__annotate__�s6���
�
��
�&)�B�J�J�&6�
�@C�
�	
�
r1c���[U[O2%c6UOUO	U2UQUQUO
02P!UO
UUQUQUQUQU02P!)�=z does not match z	expected z, got )rsr�r�r�r��patternr�)r-rrVr�s&&&&r.�_assertMatchOK�TestMain._assertMatchOK�s{���h��
�
�+�+��O�O����v�&��%�q��� 0��1A�1A�0B�C�
�

������C�5��(��6�#��a��x�@�
r1�as_file�	as_module�
pythonstartupc���[2oQUQ$[O29^tt^2o[OU2Q*oUO2UQ*oUO
QQQ5UQ*o	U	O
QQQ5ST
t,tFDo
Q	U
*Q
*MJ	to
Q,*oU%c[U	2UQ$U%cU%cUOQ
2LeU%c#UOU[U2,UP	Q5vq�L;U%cUOUQQ,UUP	Q5vq�LUOU,UUP	Q5vq�PPP2UOW
]2UO2FD�vq�UOV�Q59^tt^2[OQU
Q0W29o%c$UOV�UO!]2Q5LUOU
QU8QU02PPP2J�	UO#QW2UO#QU2P!tto
h)%fhK�9h)%fhJ�9h)ry�NO_COLOR�bluezcalx.pyzFOO = 42r])�encodingz
startup.pyzBAR = 64z
print(f'^{z=}')rurPz,as_file and as_module are mutually exclusive)r2r;r4z-mz	blue.calx)r2r;r3r4)rrVz\^z=(.+?)[\r\n])r�z= not found in output: z

rTrU)r
rKrLr\r]ror�r>r|rQr�r&r/r��searchr��groupr�)r-�expectationsr�r�r��	clean_env�tdr�r��startupr�commandsr�r�rV�ms&&$$$           r.�_run_repl_globals_test�TestMain._run_repl_globals_tests.��"�$�	� #�	�*��
�
(�
(�
*�
*�b��<�<��#�f�,�D��J�J�L���"�C��N�N�:��N�8��\�)�G����z�G��<�7C��7C���s�"�V�+�+�|���
��H��-0��\�	�/�*��9��	�	�H�I��$(�M�M��"%�c�(��!��	%2�%�!��	��$(�M�M��"&��!4�!���%2�%�!��	�%)�M�M��!#�!���%2�%�!��=+�L	
����A�&�)�/�/�1�M�C����#��9�9��	�	�R��u�L�"9�6�B�B�1�B��'�'��a�g�g�a�j�'�I��I�I���%<�V�J�d�6�(�S�T�	:�9�2�	
����f�-�����f�-��Q�+�
*��P:�9�9�sZ�A)H<�H7�2H<�H<�H<�#H<�=)H<�'3H<�$#I	�=I	�7H<�<I	�I	�I 
�I 
c�6�QQQQ-oUOU2P!)r��
'__main__'rI�None�r��r-r�s& r.�#test_globals_initialized_as_default�,TestMain.test_globals_initialized_as_defaultDs#�����6�
��
	
�#�#�L�1r1c�>�QQQQQQ-oUOUP	Q5P!)�BAR�64r�r�rIr�)r�r�r�s& r.�+test_globals_initialized_from_pythonstartup�4TestMain.test_globals_initialized_from_pythonstartupLs-���4����6�
��	
�#�#�L��#�Er1c�>�QQQQQQ-oUOUP	Q5P!)�FOO�42r�r�rIr�)r�r�r�s& r.�.test_inspect_keeps_globals_from_inspected_file�7TestMain.test_inspect_keeps_globals_from_inspected_fileUs-���4����6�
��	
�#�#�L�$�#�?r1c�D�QQQQQQQQ-oUOUP	P	Q5P!)	r�r�r�r�r�r�rIr�)r�r�r�r�s& r.�Atest_inspect_keeps_globals_from_inspected_file_with_pythonstartup�JTestMain.test_inspect_keeps_globals_from_inspected_file_with_pythonstartup^s4���4��4����6�	
��	
�#�#�L�$�d�#�Sr1c
�j�QQQQQQQ[OQ2-oUOUP	Q5P!)	r�r�r�r�rI�'blue'�__file__�
^'.*calx.py'$)r��r��compiler�r�s& r.�0test_inspect_keeps_globals_from_inspected_module�9TestMain.test_inspect_keeps_globals_from_inspected_modulehs<���4����8���
�
�#3�4�	
��	
�#�#�L�D�#�Ar1c�p�QQQQQQQQQ[OQ	2-oUOUP	P	Q
5P!)r�r�r�r�r�r�rIr�r�r�)r�r�r�r�s& r.�Ctest_inspect_keeps_globals_from_inspected_module_with_pythonstartup�LTestMain.test_inspect_keeps_globals_from_inspected_module_with_pythonstartupqsD���4��4����8���
�
�#3�4�
��	
�#�#�L�D�PT�#�Ur1c���[OO2oQoUOQP2UO	V!P	Q5vq4UOU]2UO
QU2UO
QU2UO
QU2QoQUQ$UO	VQQ5vq4UOU]2UOQ	U2UO
QU2UO
QU2Q
oQUQ$UO	VaQ5vq4UOU]2UOQU2UO
QU2UO
QU2UO
QU2P!)
z
clear
exit()
rO�r;r4rT�	NameErrorrUzhelp
exit()
ryrSz Type help() for interactive helpz2import sys
print('_pyrepl' in sys.modules)
exit()
�False�True)rdrqrVr�rQr�r�r�)r-r;�pyrepl_commandsr�r��basic_commandsr�s&      r.�test_python_basic_repl�TestMain.test_python_basic_repl{sR���j�j�o�o���+�����#�T�*� �M�M�/��M�N�������A�&�����f�-�����f�-�����f�-�)��#&��� � �M�M�.�M�B�������A�&��
�
�8�&�A�����f�-�����f�-���$'��� � �M�M�(�M�<�������A�&��
�
�g�v�&������(�����f�-�����f�-r1c	��[OO[QQ2oUO	[OOU2U2[
U29^tt^2oUO2oPPP2[[P[[OW222oQFDoUOVC2J	P!)%fhKZ9h)rLz__main__.py)�?zunknown-filenamez<foo>z<...>)rdrerfrr��exists�open�	readlinesr?�filter�mapr>�strip�_test_no_pyrepl_source_in_exc)r-�pyrepl_main_file�fp�excluded_linesr�s&    r.�test_no_pyrepl_source_in_exc�%TestMain.test_no_pyrepl_source_in_exc�s����7�7�<�<�
�I�}�M����������'7�8�:J�K�
�"�
#�
#�r��\�\�^�N�$��f�T�3�s�y�y�.�+I�J�K��C�H��.�.�x�H�D�	$�
#�s�)C�C	�C	c
��[29^tt^2p0OUQ59^tt^2UOQ2QU8Q0oUOVCQ5vqVUO	QU2UO	QU2SFD7oUOUQ59^tt^2UOVu2PPP2J9	PPP2PPP2P!)%fhJ^9h)%fhK.9h)%fhP!9h))r�rOzeval(compile('spam', z, 'eval'))
exit()
rSz!Traceback (most recent call last)z%NameError: name 'spam' is not defined)�line)rr/�unsetrQr�r�)r-r�r�r;r�r�r�r�s&&&     r.r��&TestMain._test_no_pyrepl_source_in_exc�s���
 �
"�
"�c�<�<��<�+J�+J��I�I�)�*�/��|�<#�$�H��
�
�h�
�8�I�F��M�M�=�v�F��M�M�A�6�J�&���\�\�t�\�,�,��$�$�T�2�-�,�'�,K�
"�
"�-�,�,��,K�+J��
"�
"�
"�sM�C6�A1C#	�C�1C#	�=C6�C �C �	C#	�#C3
�,C3
�.C6�6D	�?D	c�`�[OO2oQoU1QkoUOQP2RO	V!P	Q5vqEUVE2QUQ$RO	V!Q5vqEUVE2P!)z)import sys
sys.excepthook = 1
1/0
exit()
c��:�ROQU2ROUOQ2]2ROQU2ROQU2ROU]2P!)zError in sys.excepthook:z'int' object is not callablezOriginal exception was:zdivision by zero)r�r��count)r��exitcoder-s&&�r.�check�CTestMain.test_bad_sys_excepthook_doesnt_crash_pyrepl.<locals>.check�sZ����M�M�4�f�=����V�\�\�*H�I�1�M��M�M�3�V�<��M�M�,�f�5����X�q�)r1rOr�ryrS)rdrqrVr�rQ)r-r;r�r�r�r�sf     r.�+test_bad_sys_excepthook_doesnt_crash_pyrepl�4TestMain.test_bad_sys_excepthook_doesnt_crash_pyrepl�ss����j�j�o�o�����
	*�	���#�T�*� �M�M�(�$�M�G���
�f� �#&��� � �M�M�(�M�<���
�f� r1c��[Q2[OP
Q5oUO[UO
2[OO2oUO
UQ$QoUOQP2UOV2Q5vqEUOU]2UOQU2UOQU2UO[OUO
2O!2O"]2UO$O'2UO)2QUQ$UOV2Q5vqEUOU]2UOQU2UOQU2UO[OUO
2O!2O"]2P!)	r0rrVz123
spam
exit()
rOrS�123�spamry)rrKr�rnrrMrdrqrVr�rQr�r��assertNotEqualr\r]�stat�st_size�file�truncaterr)r-�hfiler;r�r�r�s&     r.�test_not_wiping_history_file�%TestMain.test_not_wiping_history_file�sY���j�!��+�+�5�9�������
�
�+��j�j�o�o��� %�
�
����(�����#�T�*� �M�M�(�M�<�������A�&��
�
�e�V�$��
�
�f�f�%����G�L�L����4�9�9�;�C�C�Q�G�
�
�
����
���
�#&��� � �M�M�(�M�<�������A�&��
�
�e�V�$��
�
�f�f�%����G�L�L����4�9�9�;�C�C�Q�Gr1c�.�[OO2oQoUOV!P	Q5vq4UO	QU2UO	QU2QoUOV!Q5vq4UO	QU2UO	QU2P!)z
a b c
exit()
r�zSyntaxError: invalid syntaxz<python-input-0>z
 b
exit()
rSz#IndentationError: unexpected indent)rdrqrVrQr�)r-r;r�r�r�s&    r.�%test_correct_filename_in_syntaxerrors�.TestMain.test_correct_filename_in_syntaxerrors�s����j�j�o�o���$�� �M�M�(�$�M�G����
�
�3�V�<��
�
�(�&�1�!�� �M�M�(�M�<����
�
�;�V�D��
�
�(�&�1r1c��[OO2oQFCDoQU%cQLP*Q*oQFD�oU%cQUQ$LUOQP2UO	UUQ59^tt^2UOV1P	Q5vqVUO
QU2U%c8UOQ	U2UOQ
U2UOQU2L6UO
Q	U2UO
Q
U2UO
QU2PPP2J�	CJ	P!)%fhJ�9h)
Tzimport sys
zsys.tracebacklimit = 1
z;def x1(): 1/0

def x2(): x1()

def x3(): x2()

x3()
exit()
ryrO)�set_tracebacklimit�
basic_replr�zin x1zin x2zin x3zin <module>)TF)rdrqrVr�r/rQr�r�)r-r;r�r�r�r�r�s&      r.�test_proper_tracebacklimit�#TestMain.test_proper_tracebacklimit�s���j�j�o�o���"/��&�7I�3�r�S�#�#�H�,�
��/2�C�+�,��G�G�/��6��\�\�5G�-7�"�9�9�(,�
�
�h�d�
�(S�%�F��M�M�'�6�2�)��(�(��&�9��(�(��&�9��(�(���?��
�
�g�v�6��
�
�g�v�6��
�
�m�V�<�9�9�,�#0�9�9�9�s�/D2
�2A-D2
�2E�;Ec�v�UOQ2vqUOU]2UOQU2P!)z	
exit()
�	TypeError)rQr�r��r-r�r�s&  r.�test_null_byte�TestMain.test_null_byte	s4�� �M�M�*:�;�������A�&�����f�-r1c��QoUOU2vq#UOU]2UOQU2UOQU2P!)zNimport runpy
runpy._run_module_code('blech', {0: '', 'bluch': ''}, '')
exit()
z,all elements in 'candidates' must be strings�bluch)rQr�r�r�)r-r�r�r�s&   r.�%test_non_string_suggestion_candidates�.TestMain.test_non_string_suggestion_candidates	sK����!�M�M�(�3�������A�&����G��P��
�
�g�v�&r1c��[Q2oUOQ6wcUOQ2[O29^tt^2o[
OO2oUOUQ$QUQ$UOQUQ5vqEUOU]2UOQU2UO[OUO2O2O ]2UOQ	[OUO2O#22UO%QP2UOQ
UQ5vqEUOU]2UO'Q[OUO2O#22PPP2P!)%fhP!9h)r0�editlinez*GNU readline is not affected by this issuerVryrOz
spam 
exit()
rSzspam zspam\040zexit
z\040)r�backendr~rKr�rdrqrVrMrQr�r�r�r\r]r�r��	read_textr�r�)r-r0r�r;r�r�s&     r.�test_readline_history_file�#TestMain.test_readline_history_file	sO�� ��,�����z�)��M�M�F�G�
�
(�
(�
*�
*�e��*�*�/�/�#�C�$)�J�J�C� �!�'*�C�#�$� $�
�
�.?�S�
� I��F����Y��*��M�M�'�6�*�������U�Z�Z� 8� =� =� ?� G� G��K��M�M�+�w�|�|�E�J�J�'?�'I�'I�'K�L��G�G�'��.� $�
�
�h�C�
� @��F����Y��*����W�g�l�l�5�:�:�&>�&H�&H�&J�K�+�
*�
*�
*�s�E)F?�?G	�G	c��[OO2o[O29^tt^2oUO
UQ$QoUO
V1P	Q5vqEUOU]2QoUO
V1QQ5vqEUOU]2[OUO
2O2oUOQU2UOQU2UOQU2UOQ	U2UOQ
U2UOQU2PPP2P!)%fhP!9h)rVz
1
2
3
exit()
r�z.spam
import time
0xcafe
time.sleep(1000)
quit
�51966)r;r6�2rur�zimport time�sleep�quit)rdrqrVrKr�rMrQr�r�r\r]r�r�r�)r-r;r�r�r�r�r�s&      r.�test_history_survive_crash�#TestMain.test_history_survive_crash4	s���j�j�o�o���
�
(�
(�
*�
*�e�$)�J�J�C� �!�*�H� $�
�
�h�d�
� K��F����Y��*�
M�H� $�
�
�h�=D�!.�!F��F����	�1�-��l�l�5�:�:�.�8�8�:�G��M�M�#�w�'��M�M�(�G�,��M�M�&�'�*��M�M�-��1�
���W�g�.����V�W�-�1+�
*�
*�
*�s�C<E�E	�E	c�R�UOQ2vqUOU]2P!)zexit
)rQr�r�s&  r.�%test_keyboard_interrupt_after_isearch�.TestMain.test_keyboard_interrupt_after_isearchQ	s$�� �M�M�*:�;�������A�&r1c���UO,QN2vq[OQ2oUOPU2oUO	U]2UOQU2P!)�helpz"(\x1B(=|>|(\[)[0-?]*[ -\/]*[@-~]))z>>> 
>>> >>>)r�q�exit)rQr�r��subr�r�)r-r�r��ansi_escape�cleaned_outputs&    r.�test_prompt_after_help�TestMain.test_prompt_after_helpU	sW�� �M�M�*?�@����j�j�!F�G��$����V�4������A�&�
	
����.�9r1z--X showrefcount requires a Python debug buildc��[OO2oUOQP2UO	QQ,UQ5vq#[
OQU2oUO[U2]2QUQ$UO	QQ,UQ5vq#[
OQU2oUO[U2]2P!)rOz
1
1+2
exit()
z-Xshowrefcount)r2r;z\[-?\d+ refs, \d+ blocks\]ry)	rdrqrVr�rQr��findallr�r�)r-r;r�r�r�s&    r.�test_showrefcount�TestMain.test_showrefcountb	s����j�j�o�o������#�R�(��M�M�"4�DT�CU�[^�M�_�	���*�*�:�F�C������W��q�)�#&��� ��M�M�"4�DT�CU�[^�M�_�	���*�*�:�F�C������W��q�)r1c	��QFDcoUOUQ59^tt^2UOUQ0Q,2vq#UOQU2QoUOVB2PPP2Je	P!)%fhJz9h)�pip)�pip_cmdz install sampleprojectr
�SyntaxErrorzLThe Python package manager (pip) can only be used outside of the Python REPL)r�pip3z
python -m pipzpython3 -m pip)r/rQr�)r-rr�r��hints&    r.�test_detect_pip_usage_in_repl�&TestMain.test_detect_pip_usage_in_replo	su��I�G����g��.�.�$(�M�M�g�Y�>T�3U�W]�2^�$_�!���
�
�m�V�4�2���
�
�d�+�/�.�J�.�.�.�s�>A.	�.A?
�7A?
c�*�[OO2oUOQP2QUQ$QoQo[d8UOV!Q5vqEUO
U]2UOV42UOU2vqgUO
U]2]QH"G	oU[OOQP22o	,o
U	OQ2oU	OQ2oU%c5U
O[OUOQ	222U%c5U
O[OUOQ	222U%f+U%f#U
OQ
2U
OQ2U	OQ2o
U
%c=U
O[OU
OQ	22Q
*2LU
OQ2U	OQ2oU	OQ2oU%c5U
O[OUOQ	222U%c5U
O[OUOQ	222U%f+U%f#U
OQ2U
OQ2U	OQ2oU	OQ2oU%c5U
O[OUOQ	222U%c5U
O[OUOQ	222U%f+U%f#U
OQ2U
OQ2U
OQ2U
OQ2U
OQ2[OQO!U
22oUO#PU2oUOUU2P!)rOryz.print('Something pretty long', end='')
exit()
zSomething pretty long>>> exit()rS)rfrQ�smkx�rmkx�asciiz
\x1b\[\?1[hl]z\x1b[=>]�ich1z	(?=[ -~])z\x1b\[(?:1)?@(?=[ -~])�civis�cnormz\x1b\[\?25[hl]z\x1b\[\?12[hl]�rmam�smamz
\x1b\[\?7lz
\x1b\[\?7hz\x1b\[\?2004[hl]z
\x1b\[\?[01]c�|)rdrqrVr��readline_modulerQr�r��_pyrepl.terminforfr\rcr��escaperxr�rfr)r-r;r��expected_output_sequence�basic_output�basic_exit_coder�r�rf�ti�
safe_patternsrrr r!r"r#r$�safe_escapesr
s&                   r.�test_no_newline�TestMain.test_no_newlinez	s����j�j�o�o������#�R�(�#&��� �E��#D� ��&�,0�M�M�(�M�,L�)�L����_�a�0��M�M�2�A� �M�M�(�3�������A�&�
	.�
�b�j�j�n�n�V�R�0�
1���
��v�v�f�~���v�v�f�~���� � ����4�;�;�w�+?�!@�A��� � ����4�;�;�w�+?�!@�A��D�� � �!1�2�� � ��-��v�v�f�~���� � ����4�;�;�w�+?�!@�<�!O�P�� � �!:�;����w������w����� � ����5�<�<��+@�!A�B��� � ����5�<�<��+@�!A�B��U�� � �!2�3�� � �!2�3��v�v�f�~���v�v�f�~���� � ����4�;�;�w�+?�!@�A��� � ����4�;�;�w�+?�!@�A��D�� � ��/�� � ��/�	���0�1����.�/����-�.��z�z�#�(�(�=�"9�:��%�)�)�"�f�5���
�
�.��?r1r�)$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�rrrrrrrr/r�r��
__classcell__�rrrFs@@r.rjrj�sX������B��B�(
�
��3.�e�3.�u�3.�di�3.��3.�j2�F�@�T�B�V��.��.�<�
I��
I�
3��!��!�*H�6�	2��	2��=��=�:.�
�'��'�L�,.�:'�:���I�J�
*�K�
*�	,��I@��I@�I@r1rj�darwinz
macOS onlyc�8``�\sQsQsnQU1QkksQsUsU9s!)�TestMainAppleTerminali�	c�|:�Ue[OO2oQUQ$[RU_U1QU-U@!)N�Apple_Terminal�TERM_PROGRAMr;)rdrqrVrmrQ)r-r:r;�kwargsrrs&&&,�r.rQ�TestMainAppleTerminal.run_repl�	s<����;��*�*�/�/�#�C�.��N���w��
�>��>�v�>�>r1r�r�)r�r�r�r�rQr�r�r1r2s@@r.r5r5�	s����?�?r1r5c�L`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�TestPyReplCtrlDi�	c�N�[U2o[PQ5o[V#Q5oU!r�r�r�s&&   r.r��TestPyReplCtrlD.prepare_reader�	r�r1c���[QQ[Q2Q5,oUOU2oUO[29^tt^2[U2PPP2P!)%fhP!9h)r���r�)rr�r�r��EOFErrorr)r-r�r�s&  r.�test_ctrl_d_empty_line�&TestPyReplCtrlD.test_ctrl_d_empty_line�	sV��
�e�&�i��.@�A�
���$�$�V�,��
�
�
�x�
(�
(��F�#�)�
(�
(�
(�s�A�A/	�'A/	c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UO2UOQPOUO22P!)zdef f():
    pass
r�r@rAr�)r�r�rrr�rr��finishedr�rfr�r�s&   r.�#test_ctrl_d_multiline_with_new_line�3TestPyReplCtrlD.test_ctrl_d_multiline_with_new_line�	sk������1�2��%�f�)�G�2D�E�
�
��&�f�-�	��������(����/�������1G�Hr1c�V�[O[Q2[QQ[	Q2Q5,]*[QQ[	Q2Q5,2o[U2vq#UO
UO2UOQPOUO22P!)zdef f():
    hello worldr�r�r�r�r@rAzdef f():
    hello orld�r�r�rrr�r�assertFalserFr�rfr�r�s&   r.�$test_ctrl_d_multiline_middle_of_line�4TestPyReplCtrlD.test_ctrl_d_multiline_middle_of_line�	s�������6�7��%�f�)�I�2F�G�
��
��%�f�)�G�2D�E�
�
��&�f�-�	��������)����3�R�W�W�V�]�]�5K�Lr1c
��[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
UO2UOQPOUO22P!)zdef f():
    hellor�r@rAr�rJr�s&   r.�,test_ctrl_d_multiline_end_of_line_no_newline�<TestPyReplCtrlD.test_ctrl_d_multiline_end_of_line_no_newline
sm������0�1��%�f�)�G�2D�E�
�
��&�f�-�	��������)����.�����
�
�0F�Gr1c��[O[Q2[QQ[	Q2Q5,[QQ[	Q2Q5,2o[U2vq#UO
QPOUO22P!)�hellor�r�r�r�r@rA�hell�	r�r�rrr�rr�rfr�r�s&   r.�&test_ctrl_d_single_line_middle_of_line�6TestPyReplCtrlD.test_ctrl_d_single_line_middle_of_line
sk������7�#�
�u�6�y��/C�
D�E�
�u�6�y��/A�
B�C�
��
&�f�-�	������������!7�8r1c
���[O[Q2[QQ[	Q2Q5,2o[U2vq#UO
QPOUO22P!)rRr�r@rAr�rTr�s&   r.�&test_ctrl_d_single_line_end_no_newline�6TestPyReplCtrlD.test_ctrl_d_single_line_end_no_newline
sW������7�#�
�u�6�y��/A�
B�C�
��&�f�-�	������"�'�'�&�-�-�"8�9r1r�)
r�r�r�r�r�rCrGrLrOrUrXr�r�r�s@r.r<r<�	s0�����$�
I�
M�
H�9�:�:r1r<�win32zwindows console onlyc�B`�\sQsQsnQQksQQksQsQsQsUs	P!)	�TestWindowsConsoleEolWrapi&
c�^�]QHGo]QH
Go[OUO2oVmQUmUOP,Q2Um
[2Um[2Um
[2Um[2Um[2Um[2UmVB1!)r)�windows_console)�RenderedScreenr�)rLr^�_pyrepl.renderr_r�__new__�WindowsConsole�width�posxy�from_screen_lines�_rendered_screenr�_hide_cursor�_show_cursor�
_erase_to_end�_move_relativer��_WindowsConsole__write)r-rc�wcr_r�s&&   r.�_make_mock_console�,TestWindowsConsoleEolWrap._make_mock_console(
s���1�1��.�.��!2�!2�3���
���
�#1�#C�#C�R�D�&�#Q�� �#�v���#�v��� $����!%����"�f���)-���&��{�r1c���]QHGoUOU2oUOU2o	UOO	VV�U2o
U
dUOOV2P!P!)r)�
RenderLine)r`rp�from_rendered_textrb�"_WindowsConsole__plan_changed_line�"_WindowsConsole__apply_line_update)r-r�rl�y�old_line�new_line�pxrp�
old_render�
new_renderrWs&&&&&&&    r.�_apply_changed_line�-TestWindowsConsoleEolWrap._apply_changed_line;
sf��-��2�2�8�<�
��2�2�8�<�
��"�"�E�E��
��
�������@�@��
�r1c��]
o]oUOUQ5vq4UOV4UPQ2UOUO]U12P!)r��rc�aaa�rmrzr�rd�r-rcrtr�rls&    r.�#test_short_line_sets_posxy_normally�=TestWindowsConsoleEolWrap.test_short_line_sets_posxy_normallyH
sM����
���-�-�E�-�:���� � ��a��W�=��������A��/r1c��]
o]oUOUQ5vq4UOV4UPQU*2UOUOU]*
U12P!)r�r}rQrr�s&    r.�#test_exact_width_line_does_not_wrap�=TestWindowsConsoleEolWrap.test_exact_width_line_does_not_wrapO
sU����
���-�-�E�-�:���� � ��a��S�5�[�A����������A��7r1r�)�Pr)
r�r�r�r�rmrzr�r�r�r�r�s@r.r\r\&
s�����&�0�8�8r1r\c�f�U]6�cPg-][7c[[*P*9Q$!)r9r
)�__conditional_annotations__r�r>)rEs"r.rGrGs$����R7&�%�s�3�x�$��%�S7r1)cr�rrr�r�rdr\r}r�r�rvrorarK�	functoolsrr�unittestrrr�
unittest.mockrr	r��test.supportr
rrr
rrrr�test.support.import_helperr�test.support.os_helperrr�supportrrrrrrr�	_colorizerrrLr�_pyrepl.consoler�_pyrepl.completing_readerr �_pyrepl._module_completerr!r"r#�_pyrepl.fancycompleterr$r�r%�_pyrepl.readliner0rr&r'r(r�r_�ImportErrorr&rr*r�rr*r�r�r�rr
r�addaudithook�contextmanagerrrr$r-rMrhrj�platformr5r<r\rG)r�s@r.�<module>r�s�������	��	���	��
��
����3�3�%����K�J�4�>����,��!�0���
Q�*���
I����&���
m!�8�m!�`d-��d-�N	l.�8�l.�^_B�'��_B�D	Z5�(�Z5�z?
�x�?
�D((�h�((�Vl	"��l	"�b"&�
�%� ������������0�(�0�2
2�h�
2�\-�X�\-�~�C�� �.�|�.�!�.�	9��C�� ��O��B�C�d@�|�d@�D�!�d@�N�C�L�L�H�$�l�3�?�H�?�4�?�Q:�h�Q:�h�C�L�L�G�#�%;�<�-8��-8�=�-8��YO��
�C������O������G��sH�H.�"H>�(I�.H;�4H;�:H;�>I�I�
I�I�I�I

Youez - 2016 - github.com/yon3zu
LinuXploit