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

Method terminate

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

Terminates the process.

(self)

Source from the content-addressed store, hash-verified

1665 raise ValueError("Unsupported signal: {}".format(sig))
1666
1667 def terminate(self):
1668 """Terminates the process."""
1669 # Don't terminate a process that we know has already died.
1670 if self.returncode is not None:
1671 return
1672 try:
1673 _winapi.TerminateProcess(self._handle, 1)
1674 except PermissionError:
1675 # ERROR_ACCESS_DENIED (winerror 5) is received when the
1676 # process already died.
1677 rc = _winapi.GetExitCodeProcess(self._handle)
1678 if rc == _winapi.STILL_ACTIVE:
1679 raise
1680 self.returncode = rc
1681
1682 kill = terminate
1683

Callers 1

send_signalMethod · 0.95

Calls 1

send_signalMethod · 0.95

Tested by

no test coverage detected