MCPcopy Index your code
hub / github.com/RustPython/RustPython / send_signal

Method send_signal

Lib/subprocess.py:1686–1698  ·  view source on GitHub ↗

Send a signal to the process.

(self, sig)

Source from the content-addressed store, hash-verified

1684 return (stdout, stderr)
1685
1686 def send_signal(self, sig):
1687 """Send a signal to the process."""
1688 # Don't signal a process that we know has already died.
1689 if self.returncode is not None:
1690 return
1691 if sig == signal.SIGTERM:
1692 self.terminate()
1693 elif sig == signal.CTRL_C_EVENT:
1694 os.kill(self.pid, signal.CTRL_C_EVENT)
1695 elif sig == signal.CTRL_BREAK_EVENT:
1696 os.kill(self.pid, signal.CTRL_BREAK_EVENT)
1697 else:
1698 raise ValueError("Unsupported signal: {}".format(sig))
1699
1700 def terminate(self):
1701 """Terminates the process."""

Callers 4

terminateMethod · 0.95
killMethod · 0.95
test_send_signal_raceMethod · 0.95

Calls 4

terminateMethod · 0.95
pollMethod · 0.95
killMethod · 0.45
formatMethod · 0.45

Tested by 2

test_send_signal_raceMethod · 0.76