mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
a49b427b02
commit
9898e61041
6 changed files with 146 additions and 17 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue