Skip to content

Commit 26ce31b

Browse files
committed
fix: use spawn_python
Signed-off-by: yihong0618 <[email protected]>
1 parent 30cd34d commit 26ce31b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/test/test_repl.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
SuppressCrashReport,
1515
SHORT_TIMEOUT,
1616
)
17-
from test.support.script_helper import kill_python
17+
from test.support.script_helper import kill_python, spawn_python
1818
from test.support.import_helper import import_module
1919

2020
try:
@@ -119,14 +119,13 @@ def test_exec_set_nomemory_hang(self):
119119
import traceback
120120
traceback.print_exc()
121121
""")
122-
p = spawn_repl()
123122
with SuppressCrashReport():
124-
p.stdin.write(user_input)
123+
p = spawn_python('-c', user_input)
125124
output = kill_python(p)
126125

127126
self.assertIn(p.returncode, (0, 1, 120))
128127
self.assertGreater(len(output), 0) # At minimum, should not hang
129-
self.assertIn("MemoryError", output)
128+
self.assertIn(b"MemoryError", output)
130129

131130
@cpython_only
132131
def test_multiline_string_parsing(self):

0 commit comments

Comments
 (0)