summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_interpreters/utils.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-12-12 18:06:06 (GMT)
committerGitHub <noreply@github.com>2023-12-12 18:06:06 (GMT)
commit9898e6104171dcdd88b32776e69ca2cddf515e63 (patch)
treeffc33f1653dbbb7737a18bdf3db474b1b5203a89 /Lib/test/test_interpreters/utils.py
parenta49b427b0265c415d9089da0be39f4b5ccd1f15f (diff)
downloadcpython-9898e6104171dcdd88b32776e69ca2cddf515e63.zip
cpython-9898e6104171dcdd88b32776e69ca2cddf515e63.tar.gz
cpython-9898e6104171dcdd88b32776e69ca2cddf515e63.tar.bz2
gh-76785: Add Interpreter.prepare_main() (gh-113021)
This is one of the last pieces to get test.support.interpreters in sync with PEP 734.
Diffstat (limited to 'Lib/test/test_interpreters/utils.py')
-rw-r--r--Lib/test/test_interpreters/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_interpreters/utils.py b/Lib/test/test_interpreters/utils.py
index 623c873..11b6f12 100644
--- a/Lib/test/test_interpreters/utils.py
+++ b/Lib/test/test_interpreters/utils.py
@@ -29,10 +29,12 @@ def clean_up_interpreters():
pass # already destroyed
-def _run_output(interp, request, channels=None):
+def _run_output(interp, request, init=None):
script, rpipe = _captured_script(request)
with rpipe:
- interp.exec_sync(script, channels=channels)
+ if init:
+ interp.prepare_main(init)
+ interp.exec_sync(script)
return rpipe.read()