python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_repl.cpython-312.pyc

Αe:dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZe	sejdejejddZd	ZGd
dej$ZGdd
ej$Zedk(rej,yy)z!Test the interactive interpreter.N)dedent)cpython_onlyhas_subprocess_supportSuppressCrashReport)kill_pythonztest module requires subprocess)stdoutstderrc	tjjtjjtj
d}|ddg}|j
||jdttj}d|d<tj|ftj
dtj||d|S)	zRun 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-ienvvt100TERMT)
executabletextstdinrr	)
ospathjoindirnamesysrextend
setdefaultdictenviron
subprocessPopenPIPE)rr	argskwstdin_fnamecmd_liners       B/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_repl.py
spawn_replr"s'',,rwws~~>	JKT4(HOOD
--tBJJ/
0CCKH"'*~~!%",//#)&	"
!""ct}|jj|t|}|jdk7rtd|S)zSpawn a new Python interpreter, pass the given
    input source code from the stdin and return the
    result back. If the interpreter exits non-zero, it
    raises a ValueError.rzProcess didn't exit properly.)r"rwriter
returncode
ValueError)sourceprocessoutputs   r!run_on_interactive_moder+,sFlGMM

!FQ899Mr#c2eZdZedZedZdZy)TestInteractiveInterpretercd}t|}t}t5|jj	|dddt|}|j
d||j
|jdy#1swYCxYw)Nz
            import sys, _testcapi
            1/0
            print('After the exception.')
            _testcapi.set_nomemory(0)
            sys.exit(0)
        zAfter the exception.)x)rr"rrr%rassertInr&self
user_inputpr*s    r!test_no_memoryz)TestInteractiveInterpreter.test_no_memory=sq

J'
L
 
"	&
GGMM*%	&Q

,f5

allH-	&	&sBB	cd}t|}t}|jj|t	|}|j|jdy)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)rr"rr%rassertEqualr&r2s    r!test_multiline_string_parsingz8TestInteractiveInterpreter.test_multiline_string_parsingRsI
.J'
L	

j!Qq)r#ctd}td}td|}|j|d}|j|jd|jd|y)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"communicater8r&r1)r3r4prepare_replr)r*s     r!test_close_stdinz+TestInteractiveInterpreter.test_close_stdinssi


T<0$$Z03++Q/

nf-r#N)__name__
__module____qualname__rr6r9r=r#r!r-r-;s...(**@
.r#r-ceZdZdZy)TestInteractiveModeSyntaxErrorsc~ttd}|jdd}gd}|j||y)NzJ        def f():
            print(0)
            return yield 42
        )z    return yield 42z           ^^^^^zSyntaxError: invalid syntax)r+r
splitlinesr8)r3r*traceback_linesexpected_liness    r!*test_interactive_syntax_error_correct_linezJTestInteractiveModeSyntaxErrors.test_interactive_syntax_error_correct_linesH(1*
!++-b4

	
.9r#N)r>r?r@rJrAr#r!rCrCs
:r#rC__main__)__doc__rrunittestrtextwraprtest.supportrrrtest.support.script_helperrSkipTestrSTDOUTr"r+TestCaser-rCr>mainrAr#r!<module>rUs'
	RR2
(

=
>>(__Z5F5F"8E.!2!2E.P:h&7&7:$zHMMOr#