MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / send_signal

Method send_signal

tools/python-3.11.9-amd64/Lib/subprocess.py:1653–1665  ·  view source on GitHub ↗

Send a signal to the process.

(self, sig)

Source from the content-addressed store, hash-verified

1651 return (stdout, stderr)
1652
1653 def send_signal(self, sig):
1654 """Send a signal to the process."""
1655 # Don't signal a process that we know has already died.
1656 if self.returncode is not None:
1657 return
1658 if sig == signal.SIGTERM:
1659 self.terminate()
1660 elif sig == signal.CTRL_C_EVENT:
1661 os.kill(self.pid, signal.CTRL_C_EVENT)
1662 elif sig == signal.CTRL_BREAK_EVENT:
1663 os.kill(self.pid, signal.CTRL_BREAK_EVENT)
1664 else:
1665 raise ValueError("Unsupported signal: {}".format(sig))
1666
1667 def terminate(self):
1668 """Terminates the process."""

Callers 2

terminateMethod · 0.95
killMethod · 0.95

Calls 4

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

Tested by

no test coverage detected