MCPcopy Index your code
hub / github.com/python/cpython / _wait_for_interp_to_run

Function _wait_for_interp_to_run

Lib/test/test__interpreters.py:40–50  ·  view source on GitHub ↗
(interp, timeout=None)

Source from the content-addressed store, hash-verified

38
39
40def _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

Callers 1

_runningFunction · 0.85

Calls 1

is_runningMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…