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

Method terminate

Lib/subprocess.py:1754–1767  ·  view source on GitHub ↗

Terminates the process.

(self)

Source from the content-addressed store, hash-verified

1752 raise ValueError("Unsupported signal: {}".format(sig))
1753
1754 def terminate(self):
1755 """Terminates the process."""
1756 # Don't terminate a process that we know has already died.
1757 if self.returncode is not None:
1758 return
1759 try:
1760 _winapi.TerminateProcess(self._handle, 1)
1761 except PermissionError:
1762 # ERROR_ACCESS_DENIED (winerror 5) is received when the
1763 # process already died.
1764 rc = _winapi.GetExitCodeProcess(self._handle)
1765 if rc == _winapi.STILL_ACTIVE:
1766 raise
1767 self.returncode = rc
1768
1769 kill = terminate
1770

Callers 3

send_signalMethod · 0.95
async_processFunction · 0.45
cleanup_processFunction · 0.45

Calls 1

send_signalMethod · 0.95

Tested by

no test coverage detected