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.
This commit is contained in:
Eric Snow 2023-12-12 11:06:06 -07:00 committed by GitHub
parent a49b427b02
commit 9898e61041
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 146 additions and 17 deletions

View file

@ -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()