We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0ba1d5 commit 9a53e36Copy full SHA for 9a53e36
cmd2/utils.py
@@ -524,7 +524,11 @@ def send_sigint(self) -> None:
524
else:
525
# Since cmd2 uses shell=True in its Popen calls, we need to send the SIGINT to
526
# the whole process group to make sure it propagates further than the shell
527
- os.killpg(os.getpgid(self._proc.pid), signal.SIGINT)
+ try:
528
+ group_id = os.getpgid(self._proc.pid)
529
+ os.killpg(group_id, signal.SIGINT)
530
+ except ProcessLookupError:
531
+ return
532
533
def terminate(self) -> None:
534
"""Terminate the process"""
0 commit comments