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

Method terminate

Lib/subprocess.py:1700–1713  ·  view source on GitHub ↗

Terminates the process.

(self)

Source from the content-addressed store, hash-verified

1698 raise ValueError("Unsupported signal: {}".format(sig))
1699
1700 def terminate(self):
1701 """Terminates the process."""
1702 # Don't terminate a process that we know has already died.
1703 if self.returncode is not None:
1704 return
1705 try:
1706 _winapi.TerminateProcess(self._handle, 1)
1707 except PermissionError:
1708 # ERROR_ACCESS_DENIED (winerror 5) is received when the
1709 # process already died.
1710 rc = _winapi.GetExitCodeProcess(self._handle)
1711 if rc == _winapi.STILL_ACTIVE:
1712 raise
1713 self.returncode = rc
1714
1715 kill = terminate
1716

Callers 4

send_signalMethod · 0.95
pytest_sessionfinishFunction · 0.45
conftest.pyFile · 0.45

Calls 1

send_signalMethod · 0.95

Tested by 1

pytest_sessionfinishFunction · 0.36