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

Method run_action

Lib/test/test__interpchannels.py:1691–1721  ·  view source on GitHub ↗
(self, fix, action, *, hideclosed=True)

Source from the content-addressed store, hash-verified

1689 self.run_action(fix, action)
1690
1691 def run_action(self, fix, action, *, hideclosed=True):
1692 end = action.resolve_end(fix.end)
1693 interp = action.resolve_interp(fix.interp, fix.other, fix.extra)
1694 fix.prep_interpreter(interp)
1695 if interp.name == 'main':
1696 result = run_action(
1697 fix.cid,
1698 action.action,
1699 end,
1700 fix.state,
1701 hideclosed=hideclosed,
1702 )
1703 fix.record_action(action, result)
1704 else:
1705 _cid = _channels.create(REPLACE)
1706 run_interp(interp.id, f"""
1707 result = helpers.run_action(
1708 {fix.cid},
1709 {repr(action.action)},
1710 {repr(end)},
1711 {repr(fix.state)},
1712 hideclosed={hideclosed},
1713 )
1714 _channels.send({_cid}, result.pending.to_bytes(1, 'little'), blocking=False)
1715 _channels.send({_cid}, b'X' if result.closed else b'', blocking=False)
1716 """)
1717 result = ChannelState(
1718 pending=int.from_bytes(recv_nowait(_cid), 'little'),
1719 closed=bool(recv_nowait(_cid)),
1720 )
1721 fix.record_action(action, result)
1722
1723 def iter_fixtures(self):
1724 # XXX threads?

Callers 2

run_actionsMethod · 0.95
_closeMethod · 0.95

Calls 9

run_actionFunction · 0.85
run_interpFunction · 0.85
ChannelStateClass · 0.85
recv_nowaitFunction · 0.85
resolve_endMethod · 0.80
resolve_interpMethod · 0.80
prep_interpreterMethod · 0.80
record_actionMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected