(self, interpid, script, *, main=False)
| 570 | |
| 571 | @requires_test_modules |
| 572 | def run_from_capi(self, interpid, script, *, main=False): |
| 573 | with self.capturing(script) as (wrapped, results): |
| 574 | rc = _testinternalcapi.exec_interpreter(interpid, wrapped, main=main) |
| 575 | assert rc == 0, rc |
| 576 | results.raise_if_failed() |
| 577 | return results.stdout |
| 578 | |
| 579 | @contextlib.contextmanager |
| 580 | def _running(self, run_interp, exec_interp): |