HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_repl.cpython-310.opt-1.pyc
o

�i��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZejej
d�dd�ZGd	d
�d
ej�ZedkrCe��dSdS)z!Test the interactive interpreter.�N)�dedent)�cpython_only�SuppressCrashReport)�kill_python)�stdout�stderrcOshtj�tj�tj�d�}|ddg}|�|�|�dttj	��}d|d<t
j|ftjdt
j||d�|��S)	z�Run the Python REPL with the given arguments.

    kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
    object.
    z<stdin>z-Ez-i�envZvt100ZTERMT)�
executable�text�stdinrr)
�os�path�join�dirname�sysr	�extend�
setdefault�dict�environ�
subprocess�Popen�PIPE)rr�args�kwZstdin_fnameZcmd_liner�r�+/usr/local/lib/python3.10/test/test_repl.py�
spawn_repls

��rc@s,eZdZedd��Zedd��Zdd�ZdS)�TestInteractiveInterpretercCsjd}t|�}t�}t��|j�|�Wd�n1swYt|�}|�d|�|�|jd�dS)Nz�
            import sys, _testcapi
            1/0
            print('After the exception.')
            _testcapi.set_nomemory(0)
            sys.exit(0)
        zAfter the exception.)��x)rrrr�writer�assertIn�
returncode��self�
user_input�p�outputrrr�test_no_memory)s�z)TestInteractiveInterpreter.test_no_memorycCs8d}t|�}t�}|j�|�t|�}|�|jd�dS)Na        x = """<?xml version="1.0" encoding="iso-8859-1"?>
        <test>
            <Users>
                <fun25>
                    <limits>
                        <total>0KiB</total>
                        <kbps>0</kbps>
                        <rps>1.3</rps>
                        <connections>0</connections>
                    </limits>
                    <usages>
                        <total>16738211KiB</total>
                        <kbps>237.15</kbps>
                        <rps>1.3</rps>
                        <connections>0</connections>
                    </usages>
                    <time_to_refresh>never</time_to_refresh>
                    <limit_exceeded_URL>none</limit_exceeded_URL>
                </fun25>
            </Users>
        </test>"""
        r)rrrr r�assertEqualr"r#rrr�test_multiline_string_parsing>sz8TestInteractiveInterpreter.test_multiline_string_parsingcCsFtd�}td�}td|�}|�|�d}|�|jd�|�d|�dS)NzY
            import os
            print("before close")
            os.close(0)
        zl
            from test.support import suppress_msvcrt_asserts
            suppress_msvcrt_asserts()
        z-crzbefore close)rr�communicater)r"r!)r$r%Zprepare_repl�processr'rrr�test_close_stdin_s
z+TestInteractiveInterpreter.test_close_stdinN)�__name__�
__module__�__qualname__rr(r*r-rrrrr's

 r�__main__)�__doc__rrZunittestr�textwraprZtest.supportrrZtest.support.script_helperrr�STDOUTrZTestCaserr.�mainrrrr�<module>sH�