summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-20 21:26:33 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-03-20 21:26:33 -0400
commit99f98ff1280f56092f25952ca8e24cff52c09aef (patch)
treece9d9adcd4ed245be7276f80487e6f613b9ad1b3
parentfb9fe3681be570455590e09cc8a4a9ff0e4821c2 (diff)
downloadcmd2-git-99f98ff1280f56092f25952ca8e24cff52c09aef.tar.gz
Terminate pipe processes instead of sending them SIGINTs
-rw-r--r--cmd2/cmd2.py6
-rw-r--r--cmd2/utils.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 1226bc59..ae47fb4f 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1655,8 +1655,8 @@ class Cmd(cmd.Cmd):
:param frame
"""
try:
- # Forward the sigint to the current pipe process
- self.pipe_proc_reader.send_sigint()
+ # Terminate the current pipe process
+ self.pipe_proc_reader.terminate()
except AttributeError:
# Ignore since self.pipe_proc_reader was None
pass
@@ -1920,7 +1920,7 @@ class Cmd(cmd.Cmd):
# We want Popen to raise an exception if it fails to open the process. Thus we don't set shell to True.
try:
# Set options to not forward signals to the pipe process. If a Ctrl-C event occurs,
- # our sigint handler will forward it to the most recent pipe process. This makes sure
+ # our sigint handler terminate the most recent pipe process. This makes sure
# pipe processes close in the right order (most recent first).
if sys.platform == 'win32':
creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
diff --git a/cmd2/utils.py b/cmd2/utils.py
index 697cf6f8..7e36da92 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -404,10 +404,10 @@ class ProcReader(object):
if self._proc.stderr is not None:
self._err_thread.start()
- def send_sigint(self) -> None:
- """Send a SIGINT to the process"""
+ def terminate(self) -> None:
+ """Terminate the process"""
import signal
- self._proc.send_signal(signal.SIGINT)
+ self._proc.terminate()
def wait(self) -> None:
"""Wait for the process to finish"""