summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2019-04-02 22:11:58 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2019-04-02 22:11:58 -0400
commitb146e0ca216b8451c2f4ebd0791dd3227cdca192 (patch)
tree78b388fc7c42982497601387e0446e19159c1969 /cmd2/utils.py
parent8e177471575802a600fb7fbf7839638c3c4a6497 (diff)
downloadcmd2-git-b146e0ca216b8451c2f4ebd0791dd3227cdca192.tar.gz
Attempt to fix unit tests
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py
index 1f61c4a4..339d5194 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -405,9 +405,13 @@ class ProcReader(object):
self._err_thread.start()
def send_sigint(self) -> None:
- """Send a SIGINT to the process"""
+ """Send a SIGINT to the process similar to if <Ctrl>+C were pressed."""
import signal
- self._proc.send_signal(signal.SIGINT)
+ if sys.platform.startswith('win'):
+ signal_to_send = signal.CTRL_C_EVENT
+ else:
+ signal_to_send = signal.SIGINT
+ self._proc.send_signal(signal_to_send)
def terminate(self) -> None:
"""Terminate the process"""