MCPcopy Create free account
hub / github.com/pyinvoke/invoke / send_interrupt

Method send_interrupt

invoke/runners.py:1156–1172  ·  view source on GitHub ↗

Submit an interrupt signal to the running subprocess. In almost all implementations, the default behavior is what will be desired: submit ``\x03`` to the subprocess' stdin pipe. However, we leave this as a public method in case this default needs to be augme

(self, interrupt: "KeyboardInterrupt")

Source from the content-addressed store, hash-verified

1154 return default_encoding()
1155
1156 def send_interrupt(self, interrupt: "KeyboardInterrupt") -> None:
1157 """
1158 Submit an interrupt signal to the running subprocess.
1159
1160 In almost all implementations, the default behavior is what will be
1161 desired: submit ``\x03`` to the subprocess' stdin pipe. However, we
1162 leave this as a public method in case this default needs to be
1163 augmented or replaced.
1164
1165 :param interrupt:
1166 The locally-sourced ``KeyboardInterrupt`` causing the method call.
1167
1168 :returns: ``None``.
1169
1170 .. versionadded:: 1.0
1171 """
1172 self.write_proc_stdin("\x03")
1173
1174 def returncode(self) -> Optional[int]:
1175 """

Callers 1

_finishMethod · 0.95

Calls 1

write_proc_stdinMethod · 0.95

Tested by

no test coverage detected