(interp, timeout=None)
| 38 | |
| 39 | |
| 40 | def _wait_for_interp_to_run(interp, timeout=None): |
| 41 | # bpo-37224: Running this test file in multiprocesses will fail randomly. |
| 42 | # The failure reason is that the thread can't acquire the cpu to |
| 43 | # run subinterpreter earlier than the main thread in multiprocess. |
| 44 | if timeout is None: |
| 45 | timeout = support.SHORT_TIMEOUT |
| 46 | for _ in support.sleeping_retry(timeout, error=False): |
| 47 | if _interpreters.is_running(interp): |
| 48 | break |
| 49 | else: |
| 50 | raise RuntimeError('interp is not running') |
| 51 | |
| 52 | |
| 53 | @contextlib.contextmanager |
no test coverage detected
searching dependent graphs…