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

Method running

Lib/test/test_interpreters/utils.py:642–656  ·  view source on GitHub ↗
(self, interp)

Source from the content-addressed store, hash-verified

640
641 @contextlib.contextmanager
642 def running(self, interp):
643 if isinstance(interp, int):
644 interpid = interp
645 def exec_interp(script):
646 exc = _interpreters.exec(interpid, script)
647 assert exc is None, exc
648 run_interp = exec_interp
649 else:
650 def run_interp(script):
651 text = self.run_and_capture(interp, script)
652 assert text == '', repr(text)
653 def exec_interp(script):
654 interp.exec(script)
655 with self._running(run_interp, exec_interp):
656 yield
657
658 @requires_test_modules
659 @contextlib.contextmanager

Callers 3

test_runningMethod · 0.45
test_runningMethod · 0.45
test_is_runningMethod · 0.45

Calls 1

_runningMethod · 0.95

Tested by 3

test_runningMethod · 0.36
test_runningMethod · 0.36
test_is_runningMethod · 0.36